Skip to content

Comments

fix(deps): upgrade libdatadog #1039

Merged
duncanista merged 4 commits intomainfrom
jordan.gonzalez/libdatadog/upgrade-to-v28
Feb 23, 2026
Merged

fix(deps): upgrade libdatadog #1039
duncanista merged 4 commits intomainfrom
jordan.gonzalez/libdatadog/upgrade-to-v28

Conversation

@duncanista
Copy link
Contributor

@duncanista duncanista commented Feb 23, 2026

Overview

  • Upgrade libdatadog dependencies from 158b594 to c8121f4 (v28), adapting to upstream API changes (hyper_migration → http_common, HyperClient → HttpClient, new use_system_resolver field on Endpoint, SendData no
    longer Clone)
    • Rename hyper_client module to http_client to match the upstream naming change
    • Fix dual-shipping to additional endpoints: previously TracerHeaderTags::default() was used (losing all tracer metadata headers like datadog-meta-lang, datadog-meta-tracer-version, etc.). Now the real header
      tags are preserved through the aggregation pipeline and used for additional endpoints
    • Avoid unnecessary full TracerPayloadCollection clone in trace_processor by only cloning inner V07 payloads for stats generation

Changes

  • Bump all libdd-* crates to rev c8121f4 in Cargo.toml / Cargo.lock
  • Adapt to hyper_migration → http_common rename across trace_agent, stats_processor, stats_flusher, and http_client
  • Add use_system_resolver: false to all Endpoint constructions (new required field)

hyper_client.rs → http_client.rs

  • Rename module and type alias (HyperClient → HttpClient)
  • Update all consumers (trace_flusher, stats_flusher, mod.rs)

Trace flusher refactor

  • Adapt to SendData no longer being Clone: construct per-endpoint SendData objects by cloning inner V07 payloads instead of cloning the whole SendData
  • Remove override_endpoint parameter from send_traces — each SendData now carries its own target endpoint
  • Simplify retry logic comments (endpoint tracking is no longer relevant)

Preserve TracerHeaderTags for additional endpoints

  • Introduce OwnedTracerHeaderTags — an owned version of TracerHeaderTags<'a> that can be stored across async boundaries
  • Add header_tags field to SendDataBuilderInfo and thread it through the aggregation pipeline
  • Use real header tags (via to_tracer_header_tags()) when constructing SendData for additional endpoints instead of TracerHeaderTags::default()

Trace processor optimization

  • Clone only inner V07 payloads for stats generation instead of cloning the entire TracerPayloadCollection before building SendData

Tests

  • cargo check passes
  • cargo test --lib passes (481 tests)
  • Verify dual-shipped traces to additional endpoints include correct datadog-meta-* headers with DD_APM_ADDITIONAL_ENDPOINTS configured

@duncanista duncanista requested a review from a team as a code owner February 23, 2026 09:59
@@ -20,7 +20,7 @@ use tracing::debug;
/// Type alias for the HTTP client used by trace and stats flushers.
///
/// This is the client type expected by `libdd_trace_utils::SendData::send()`.
pub type HyperClient =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't an upgrade is it? This is a change in libraries we are using?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libdatadog switches away from having to having a dependency on hyper clients as its expecting to use reqwest instead, what we normally use everywhere else here, this just renames the previous client which was hyper tied to just be a "generic" type HttpClient because we are not concerned of what it is, and they're exporting it as an http helper library

@duncanista duncanista force-pushed the jordan.gonzalez/libdatadog/upgrade-to-v28 branch from 555c7cb to 1affec4 Compare February 23, 2026 12:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the libdatadog dependencies from revision 158b59471f1132e3cb36023fa3c46ccb2dd0eda1 to c8121f422d2c8d219f8d421ff3cdb1fcbe9e8b09 to incorporate vulnerability patches. The upgrade includes API changes in the libdatadog library that required corresponding updates throughout the codebase.

Changes:

  • Updated six libdd-* package dependencies to a newer revision with security fixes
  • Migrated from hyper_migration to http_common API namespace in libdd_common
  • Renamed hyper_client module to http_client and HyperClient type to HttpClient for better semantic clarity
  • Refactored trace sending logic to eliminate the with_endpoint() method and instead construct separate SendData objects per endpoint
  • Added use_system_resolver: false field to all Endpoint struct initializations
  • Refactored test helper functions in trace_aggregator.rs to reduce code duplication

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bottlecap/Cargo.toml Updated six libdd-* dependencies from revision 158b59471 to c8121f422
bottlecap/Cargo.lock Updated dependency lock file with new versions (libdd-common 1.0.0→1.1.0, libdd-tinybytes 1.0.0→1.1.0) and dependencies
bottlecap/src/traces/mod.rs Renamed hyper_client module export to http_client
bottlecap/src/traces/http_client.rs Renamed module from hyper_client, updated type aliases and imports from hyper_migration to http_common
bottlecap/src/traces/trace_processor.rs Added use_system_resolver field, refactored payload cloning to avoid unnecessary clones and preserve payloads for stats
bottlecap/src/traces/trace_flusher.rs Updated imports and types, removed with_endpoint API calls, refactored dual-shipping to create separate SendData per endpoint, added use_system_resolver field
bottlecap/src/traces/trace_aggregator.rs Extracted test helper function to reduce duplication in test setup
bottlecap/src/traces/trace_agent.rs Updated hyper_migration imports to http_common, added explicit type annotation for clarity
bottlecap/src/traces/stats_processor.rs Updated hyper_migration imports to http_common, reordered imports
bottlecap/src/traces/stats_flusher.rs Updated types and imports from hyper_client to http_client, added use_system_resolver field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#[test]
fn test_get_batch() {
let mut aggregator = TraceAggregator::default();
let tracer_header_tags = TracerHeaderTags {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include more details in the PR description. Not clear why we are having to update test cases like this is we are just doing an upgrade to dependencies. Seems like there are other changes like this as well which I wouldn't expect if we are just upgrade dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like on this test update, it just simplified data creation for easier testing, seems like we were repeating the same code over and over – although some of these deps indeed changed as they're breaking so we might see some test updates just due to the nature of it (not this one tho)

@duncanista duncanista merged commit 6c7ed88 into main Feb 23, 2026
48 of 50 checks passed
@duncanista duncanista deleted the jordan.gonzalez/libdatadog/upgrade-to-v28 branch February 23, 2026 15:17
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