Repository navigation
[SVLS-8713] feat(logs-agent): add a retry-only method and an optional flush policy - #193
Draft
litianningdatadog wants to merge 1 commit into
Draft
litianningdatadog wants to merge 1 commit into
litianningdatadog wants to merge 1 commit into
Conversation
This was referenced Oct 21, 2026
litianningdatadog
force-pushed
the
tianning.li/logs-sc-3a-key-and-url
branch
from
October 21, 2026 19:50
a08242d to
a107102
Compare
litianningdatadog
force-pushed
the
tianning.li/logs-sc-3b-retry-and-policy
branch
from
October 21, 2026 19:50
e0406de to
5ac08a9
Compare
Why: bottlecap resends failed requests once on the next flush without pulling new logs, retries most client errors, resends failures for additional endpoints, sends to all endpoints at once, and writes one error line instead of a warning per attempt. This crate did none of those, so bottlecap could not use it without changing what Lambda users see. What: the flusher gets retry(), which resends handed-back requests without draining the aggregator, and with_policy(), which takes a FlushPolicy with switches for those behaviors and a choice of failure logging. FlushPolicy::default() is today's behavior, so nothing changes for existing users. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
litianningdatadog
force-pushed
the
tianning.li/logs-sc-3b-retry-and-policy
branch
from
October 21, 2026 19:52
5ac08a9 to
a562801
Compare
litianningdatadog
force-pushed
the
tianning.li/logs-sc-3a-key-and-url
branch
from
October 21, 2026 19:52
a107102 to
7105107
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
LogFlusher::retry(Vec<RequestBuilder>): resends handed-back requests without draining the aggregator.with_policy(FlushPolicy)withretry_client_errors,return_additional_endpoint_failures,parallel_additional_endpointsandfailure_logging: FailureLogging { PerAttempt (default), OncePerRequest }.OncePerRequestwrites one error line per failed request, including the cause (status or transport error).#[non_exhaustive]on the new enums so variants can be added later.Motivation
Part of SVLS-8713: bottlecap (the Datadog Lambda Extension) is replacing its own logs aggregator and flusher with this crate. Two rules for the whole stack:
bottlecap resends a failed request once on the next flush; doing that with
flush()would also drain new logs whose results are then discarded, so logs would be lost. It also retries most 4xx (403 stays terminal), hands back failures from additional endpoints, sends to all endpoints at once, and writes one error line per failed request: the extension re-ingests its own output, so a warning per attempt would add log volume.Additional Notes
FlushPolicy::default()is today's behavior, so nothing changes for existing users.Describe how to test/QA your changes
109 tests pass (new: retry doesn't drain, each policy switch, the full bottlecap policy, one-error-per-request logging with the cause). All sc-0 tests unchanged.
Stack
Each PR is nested under the PR it builds on (and targets). Review and merge from the top down.
serverless-components (
datadog-logs-agentoptions; merge first)maindefault/fipsfeaturesretry()+FlushPolicy← this PRdatadog-lambda-extension (bottlecap)
main🤖 Generated with Claude Code