Skip to content

[SVLS-8713] test(logs): pin that a reloaded API key is used on the next flush - #1451

Draft
litianningdatadog wants to merge 1 commit into
tianning.li/logs-bc-fix-2-oversize-dropfrom
tianning.li/logs-bc-fix-3-reload-key
Draft

litianningdatadog wants to merge 1 commit into
tianning.li/logs-bc-fix-2-oversize-dropfrom
tianning.li/logs-bc-fix-3-reload-key

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).

Tests only, no production code. A new contract test reloads the API key between two flushes (api_key_secret_reload_interval) and checks that the second request carries the new key.

This works today only because each endpoint's flusher is cloned on every flush, which rebuilds its cached headers; nothing pinned it. The swap to the shared flusher must keep it.

Testing

761 tests pass (contract 36/36). 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-prod-us1

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

Copy link
Copy Markdown

Pipelines  Tests

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/datadog-lambda-extension | publish layer e2e sandbox (amd64)

View more details · View in GitLab

ℹ️ Info

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

Useful? React with 👍 / 👎

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

Why: after the logs agent migration, a reloaded API key
(api_key_secret_reload_interval) must still be sent on the next flush. That
works today only because each endpoint's flusher is cloned on every flush,
which rebuilds its saved request headers; no test pinned it.

What: a new contract test reloads the key between two flushes and checks
that the second request carries the new key. A test helper builds the
pipeline with a key factory that reloads after 1 ms. No production code
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@litianningdatadog
litianningdatadog force-pushed the tianning.li/logs-bc-fix-3-reload-key branch from 36d67b6 to ba431aa 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