Skip to content

[SVLS-8713] fix(logs): drop a log too large for any payload instead of blocking the queue - #1450

Draft
litianningdatadog wants to merge 1 commit into
tianning.li/logs-bc-fix-1-opw-extrasfrom
tianning.li/logs-bc-fix-2-oversize-drop
Draft

litianningdatadog wants to merge 1 commit into
tianning.li/logs-bc-fix-1-opw-extrasfrom
tianning.li/logs-bc-fix-2-oversize-drop

Conversation

@litianningdatadog

@litianningdatadog litianningdatadog commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Part of SVLS-8713: bottlecap is replacing its own logs aggregator and flusher with the shared datadog-logs-agent crate from serverless-components. Lambda users must not notice the swap, so the plan is: pin today's behavior with tests (this stack), fix two real bugs first so the swap stays a pure refactor (this stack), then swap the aggregator and the flusher (bc-1 and bc-2, which will be opened after the serverless-components PRs merge).

Bug: a single log larger than the 5 MiB payload limit could never be sent and stayed at the front of the queue forever, so every log after it was never sent either.

Fix: such a log is dropped with one warning and the batch keeps filling with the logs behind it. Dropped only when it can't fit even alone (len + 2 > 5 MiB, the same threshold as the shared crate); logs between 1 MiB and that limit are still sent with a warning, as before.

User-facing: worth a release note.

Testing

760 tests pass. The contract test that pinned the stuck queue now checks that the logs around the huge one are sent; new unit tests cover the size boundary. clippy and fmt clean.

Stack

Each PR is nested under the PR it builds on (and targets). Review and merge from the top down.

serverless-components (datadog-logs-agent options; merge first)

datadog-lambda-extension (bottlecap)

🤖 Generated with Claude Code

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Tests

🔄 Datadog auto-retried 2 jobs - 2 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3f01719 | Docs | View more details | Give us feedback!

…he queue

Why: a single log bigger than the 5 MiB payload limit could never be sent,
and it stayed at the front of the queue forever, so every log after it was
never sent either.

What: such a log is now dropped with one warning and the batch keeps
filling with the logs behind it. A log is dropped only when it can't fit in a
payload even on its own (its size plus the two brackets is over 5 MiB); logs
between 1 MiB and that limit are still sent with a warning, as before. The
contract test that pinned the old behavior now checks that the logs around
the huge one are sent, and new unit tests cover the size boundary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@litianningdatadog
litianningdatadog force-pushed the tianning.li/logs-bc-fix-1-opw-extras branch from 23e4789 to 897463e Compare October 21, 2026 19:53
@litianningdatadog
litianningdatadog force-pushed the tianning.li/logs-bc-fix-2-oversize-drop branch from 80158f6 to 3f01719 Compare October 21, 2026 19:53
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