Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ On next invocation your Lambda logs should start appearing in **Telemetry** -> [
| RECEIVER_PORT | Port of the logs http receiver | `4243` |
| MAX_ITEMS | Maximum number of events that can be buffered in memory | `10000` |
| MAX_BYTES | Maximum size in bytes of events that can be buffered | `262144` |
| TIMEOUT_MS | Maximum time (in milliseconds) that a batch is buffered | `1000` |
| TIMEOUT_MS | Maximum time (in milliseconds) that a batch is buffered | `25` |
| AWS_LAMBDA_RUNTIME_API | HTTP base URI to the lambda runtime API | _Provided by AWS Lambda environment_ |
| AWS_LAMBDA_RUNTIME_EXTENSION_API_VERSION | Lambda Extension API version date | `2020-01-01` |
| AWS_LAMBDA_RUNTIME_TELEMETRY_API_VERSION | Telemetry API version date | `2022-07-01` |
Expand Down
2 changes: 1 addition & 1 deletion src/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('parseEnvironmentVariables', () => {
RECEIVER_ADDRESS: 'sandbox',
MAX_ITEMS: 10000,
MAX_BYTES: 262144,
TIMEOUT_MS: 1000,
TIMEOUT_MS: 25,
RECEIVER_PORT: 4243,
sourceToken: 'source_token',
ingestionUrl: 'https://s123456.lu-trq-1.betterstackdata.com/',
Expand Down
5 changes: 4 additions & 1 deletion src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const baseSchema = z.object({
RECEIVER_ADDRESS: z.string().default('sandbox'), // `sandbox` seems to be the default accepted address
MAX_ITEMS: envNumber.default('10000'), // Maximum number of events that are buffered in memory.
MAX_BYTES: envNumber.default('262144'), // Maximum size in bytes that the logs are buffered in memory.
TIMEOUT_MS: envNumber.default('1000'), // Maximum time (in milliseconds) that a batch is buffered.
// Maximum time (in milliseconds) Lambda buffers telemetry before it hands it to the extension; the extension waits for
// this hand-off at the end of every invocation, so Lambda's minimum keeps that wait short. Raise it to get fewer, larger
// hand-offs in long invocations that log more than 40 lines per second, at that much more time per invocation.
TIMEOUT_MS: envNumber.default('25'),
RECEIVER_PORT: envNumber.default('4243'), // HTTP server receiving port
// Better Stack source token; SOURCE_TOKEN is preferred, LOGTAIL_TOKEN is kept as a fallback.
SOURCE_TOKEN: z.string().optional(),
Expand Down
4 changes: 2 additions & 2 deletions src/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('telemetrySubscription', () => {
AWS_LAMBDA_RUNTIME_TELEMETRY_API_VERSION: '2022-07-01',
RECEIVER_ADDRESS: 'sandbox',
RECEIVER_PORT: 4243,
TIMEOUT_MS: 1000,
TIMEOUT_MS: 25,
MAX_BYTES: 262144,
MAX_ITEMS: 10000,
});
Expand All @@ -54,7 +54,7 @@ describe('telemetrySubscription', () => {
schemaVersion: '2022-07-01',
destination: { protocol: 'HTTP', URI: 'http://sandbox:4243' },
types: ['platform', 'function'],
buffering: { timeoutMs: 1000, maxBytes: 262144, maxItems: 10000 },
buffering: { timeoutMs: 25, maxBytes: 262144, maxItems: 10000 },
});
});
});
Loading