feat(logs): adopt datadog-log-agent shared crate [SVLS-8713]#1096
Draft
litianningdatadog wants to merge 7 commits intomainfrom
Draft
feat(logs): adopt datadog-log-agent shared crate [SVLS-8713]#1096litianningdatadog wants to merge 7 commits intomainfrom
litianningdatadog wants to merge 7 commits intomainfrom
Conversation
0608fd8 to
49291a9
Compare
Contributor
|
Not sure it makes sense to adopt this while @lym953 is working on Durable Functions and is touching logs heavily |
Contributor
Author
I want to make this change now so future merges will be easier and safer. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace bespoke log aggregator, flusher, and intake types with the
shared datadog-log-agent crate from serverless-components.
Key changes:
- Delete bottlecap/src/logs/{aggregator,aggregator_service,constants,
flusher}.rs — superseded by the crate
- LogEntry is now the flat datadog_log_agent::LogEntry; lambda context
(arn, request_id) moves into attributes["lambda"] instead of the old
nested IntakeLog.message.lambda struct
- LogFlusher (with internal retry) replaces LogsFlusher; flush handle
type simplifies from Vec<RequestBuilder> to bool
- start_logs_agent made async to resolve the API key upfront and build
LogFlusherConfig explicitly
- Integration test updated to match the new flat JSON wire format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change LogFlusher::flush() to accept retry builders (Vec<RequestBuilder>) - Restore redrive loop in FlushingService for transient log flush failures - Update log_flush_handles type to return retry builders instead of bool - Suppress clippy::result_large_err in test modules across config and otlp
Rename LogEntry → IntakeEntry and FlusherMode → Destination to match the canonical names exported by the datadog-log-agent crate.
- Rename crate import from datadog-log-agent to datadog-logs-agent across all source files - Update rev hash to 8cb5daa7679df7d0f814aad016b592288e91cea5 to pick up upstream rename Rationale: Upstream crate in serverless-components was renamed from datadog-log-agent to datadog-logs-agent
404d432 to
b198ef3
Compare
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.
Summary
datadog-log-agentshared crate, replacing the in-house logs aggregator, flusher, and related components in bottlecapbottlecap/src/logs/aggregator.rs,aggregator_service.rs,constants.rs,flusher.rs, andlambda/mod.rsin favour of upstream types (IntakeEntry,Destination,LogFlusher)FlushingServiceto use the newLogFlusher::flush(Vec<RequestBuilder>)API with redrive support for transient failuresJIRA
https://datadoghq.atlassian.net/browse/SVLS-8713
Test plan
cargo testpasses inbottlecap/cargo clippy --workspace --all-targets --features defaultpassesbottlecap/tests/logs_integration_test.rs) passes end-to-end./runBottlecap.shto verify logs are flushed to primary and additional endpoints