Skip to content

T-16672 Throw on ingesting errors so AWS retries the invocation - #11

Merged
PetrHeinz merged 1 commit into
mainfrom
claude/t-16672-lambda-throw
Sep 3, 2026
Merged

T-16672 Throw on ingesting errors so AWS retries the invocation#11
PetrHeinz merged 1 commit into
mainfrom
claude/t-16672-lambda-throw

Conversation

@PetrHeinz

@PetrHeinz PetrHeinz commented Sep 3, 2026

Copy link
Copy Markdown
Member

During a Better Stack ingest outage, logs forwarded by this Lambda were silently lost: @logtail/node retries a failed sync 3 times, then drops the batch, console.errors, and resolves log() as success — so the invocation succeeds and AWS never retries.

This sets throwExceptions: true on the Logtail client, so a delivery failure (after the client's own retries) rejects the handler's Promise.all and fails the invocation. CloudWatch invokes the Lambda asynchronously, so AWS redelivers the batch with its default async-invoke retry policy — no setup needed from customers.

  • Delivery becomes at-least-once: if part of a batch was delivered before the failure, the AWS retry re-sends the whole batch, so duplicates are possible during flaky periods.
  • Added a test asserting the handler rejects when the ingest endpoint returns 500 (uses a cache-busting import, since the logger is built from env at module load).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PetrHeinz
PetrHeinz marked this pull request as ready for review September 3, 2026 09:42
@PetrHeinz
PetrHeinz merged commit acdbfac into main Sep 3, 2026
1 check passed
@PetrHeinz
PetrHeinz deleted the claude/t-16672-lambda-throw branch September 3, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant