Skip to content

feat(logs): adopt datadog-log-agent shared crate [SVLS-8713]#1096

Draft
litianningdatadog wants to merge 7 commits intomainfrom
tianning.li/SVLS-8573-datadog-log-agent-adoption
Draft

feat(logs): adopt datadog-log-agent shared crate [SVLS-8713]#1096
litianningdatadog wants to merge 7 commits intomainfrom
tianning.li/SVLS-8573-datadog-log-agent-adoption

Conversation

@litianningdatadog
Copy link
Contributor

@litianningdatadog litianningdatadog commented Mar 12, 2026

Summary

  • Adopts the datadog-log-agent shared crate, replacing the in-house logs aggregator, flusher, and related components in bottlecap
  • Removes bottlecap/src/logs/aggregator.rs, aggregator_service.rs, constants.rs, flusher.rs, and lambda/mod.rs in favour of upstream types (IntakeEntry, Destination, LogFlusher)
  • Updates FlushingService to use the new LogFlusher::flush(Vec<RequestBuilder>) API with redrive support for transient failures

JIRA

https://datadoghq.atlassian.net/browse/SVLS-8713

Test plan

  • cargo test passes in bottlecap/
  • cargo clippy --workspace --all-targets --features default passes
  • Logs integration test (bottlecap/tests/logs_integration_test.rs) passes end-to-end
  • Manual local test with ./runBottlecap.sh to verify logs are flushed to primary and additional endpoints

@litianningdatadog litianningdatadog force-pushed the tianning.li/SVLS-8573-datadog-log-agent-adoption branch 2 times, most recently from 0608fd8 to 49291a9 Compare March 12, 2026 17:00
@duncanista
Copy link
Contributor

Not sure it makes sense to adopt this while @lym953 is working on Durable Functions and is touching logs heavily

@litianningdatadog
Copy link
Contributor Author

Not sure it makes sense to adopt this while @lym953 is working on Durable Functions and is touching logs heavily

I want to make this change now so future merges will be easier and safer.

litianningdatadog and others added 7 commits March 12, 2026 16:31
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
@litianningdatadog litianningdatadog force-pushed the tianning.li/SVLS-8573-datadog-log-agent-adoption branch from 404d432 to b198ef3 Compare March 12, 2026 20:34
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.

2 participants