Skip to content

chore(deps): update datadog-opentelemetry and libdatadog dependencies - #163

Merged
shreyamalpani merged 3 commits into
mainfrom
shreya.malpani/update-libdatadog-deps-to-match-datadog-opentelemetry
Sep 9, 2026
Merged

chore(deps): update datadog-opentelemetry and libdatadog dependencies#163
shreyamalpani merged 3 commits into
mainfrom
shreya.malpani/update-libdatadog-deps-to-match-datadog-opentelemetry

Conversation

@shreyamalpani

Copy link
Copy Markdown
Contributor

What does this PR do?

Updates datadog-opentelemetry from a git rev (50bfea8) to 0.5.2 on crates.io to align with bumping this dependency in the Lambda Extension.

Moves every libdatadog dependency off the pinned git rev (72fa868) and onto published crates.io versions, matching exactly what dd-trace-rs's datadog-opentelemetry v0.5.2 pins:

crate version
libdd-trace-utils 10.1.0
libdd-common 5.2.0
libdd-capabilities / -impl 3.0.0 / 4.0.0
libdd-library-config 3.0.0
libdd-trace-protobuf 4.0.1
libdd-trace-stats 7.0.0
libdd-trace-obfuscation 6.0.0

Motivation

The Datadog Lambda extension links both serverless-components and datadog-opentelemetry. Cargo treats a git source as distinct from crates.io and will never unify them, so git+libdatadog#72fa868 and crates.io libdd-common 5.2.0 resolved as two separate copies of the same crate even when the code was identical — duplicate symbols, duplicate state, larger binary.

Pinning to the same crates.io versions datadog-opentelemetry uses collapses those to one copy each. Using published versions instead of a rev also means semver signals breakage instead of a rev bump silently changing APIs.

Additional Notes

Two upstream API breaks came with the bump:

  • HttpClientCapability gained new_without_connection_pooling. ProxyHttpClient now implements it (trace_flusher.rs); with_proxy was refactored into with_proxy_pooling so the non-pooled variant sets pool_max_idle_per_host(0). Like the pre-existing new_client, this constructor is unreachable on our code path — we only ever hand an already-built instance to SendData::send, and neither send_data nor send_with_retry constructs a capability itself. The comment above the constructors was widened to say so.

  • SpanConcentrator::new gained an obfuscation-config argument, gated on libdd-trace-stats/stats-obfuscation. datadog-opentelemetry pulls that feature in via libdd-data-pipeline, so feature unification turns it on for the workspace build; it's now enabled explicitly on datadog-trace-agent so standalone builds agree. We pass None, which is a no-op: it resolves to enabled: false, so add_span takes the same BorrowedAggregationKey::from_span path as the feature-off branch and every bucket flushes into unobfuscated_buckets — the field handle_flush already read. Spans are obfuscated by the trace processor (obfuscate_span in ChunkProcessor) before they reach the concentrator, so the concentrator's own resource obfuscation staying off preserves current behavior.

Neither fix changes runtime behavior. The only intended behavior change in this PR is datadog-opentelemetry itself moving from July's rev to 0.5.2.

Describe how to test/QA your changes

  • cargo build --workspace and cargo clippy --workspace --all-targets are clean.
  • cargo test --workspace passes, with one exception: test_tracer_disabled_agent_stats_enabled_uses_agent_stats fails, which I confirmed reproduces identically on the base commit — pre-existing and unrelated to this change.
  • Cargo.lock shows exactly one copy of each of the 17 libdd crates and zero remaining git sources (grep -c "libdatadog\|dd-trace-rs" Cargo.lock → 0).
  • Feature resolution verified with cargo tree -e features: https and stats-obfuscation still resolve everywhere they did before.

@shreyamalpani
shreyamalpani force-pushed the shreya.malpani/update-libdatadog-deps-to-match-datadog-opentelemetry branch from e671c27 to ed83c14 Compare September 4, 2026 17:30
`datadog-opentelemetry` 0.5.2 pulls in `libdd-remote-config` and its
transitive tail (schemars, serde_with, jiff, chrono, strum, time,
darling), so the third-party license list needs regenerating with
`dd-rust-license-tool write`. All added entries are permissive.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@shreyamalpani
shreyamalpani marked this pull request as ready for review September 8, 2026 14:59
Copilot AI lite review requested due to automatic review settings September 8, 2026 14:59
@shreyamalpani
shreyamalpani requested review from a team as code owners September 8, 2026 14:59
@shreyamalpani
shreyamalpani requested review from DarcyRaynerDD and Lewis-E and removed request for a team September 8, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It performs a broad dependency source/version migration with a large lockfile change and upstream API adjustments that warrant final human validation of runtime impact.

Pull request overview

This PR updates the workspace to use published crates.io releases for datadog-opentelemetry and the libdatadog (“libdd-*”) crate set, moving off pinned git revisions to reduce duplicate crate copies and align versions with dd-trace-rs’s datadog-opentelemetry v0.5.2 pins.

Changes:

  • Bump datadog-opentelemetry to 0.5.2 from a git rev.
  • Switch multiple libdd-* dependencies from git revs to crates.io versions, centralizing some versions via [workspace.dependencies].
  • Adjust datadog-trace-agent integration points for upstream API changes (HttpClientCapability constructor addition; SpanConcentrator::new signature change).
File summaries
File Description
LICENSE-3rdparty.csv Updates third-party license inventory for newly-resolved transitive crates.
crates/datadog-trace-agent/src/trace_flusher.rs Refactors ProxyHttpClient construction to support the new HttpClientCapability constructor surface.
crates/datadog-trace-agent/src/stats_concentrator_service.rs Updates SpanConcentrator::new call to pass the new obfuscation-config parameter (None).
crates/datadog-trace-agent/Cargo.toml Replaces libdatadog git deps with crates.io versions; enables stats-obfuscation feature on libdd-trace-stats.
crates/datadog-serverless-compat/Cargo.toml Switches libdd-trace-utils to workspace dependency with https feature.
crates/datadog-metrics-collector/Cargo.toml Switches libdd-common to workspace dependency.
crates/datadog-agent-config/Cargo.toml Bumps datadog-opentelemetry to crates.io and switches libdd deps to workspace dependencies.
Cargo.toml Adds [workspace.dependencies] entries for shared libdd versions (common/trace-utils/trace-obfuscation).
Cargo.lock Updates resolved dependency graph to match crates.io sources and new versions.
Review details
  • Files reviewed: 8/9 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@litianningdatadog litianningdatadog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@shreyamalpani
shreyamalpani merged commit 3ab0125 into main Sep 9, 2026
28 checks passed
@shreyamalpani
shreyamalpani deleted the shreya.malpani/update-libdatadog-deps-to-match-datadog-opentelemetry branch September 9, 2026 14:36
shreyamalpani added a commit to DataDog/datadog-lambda-extension that referenced this pull request Sep 9, 2026
…ponents deps (#1366)

## What does this PR do?

Moves the Datadog Lambda Extension's libdatadog and dd-trace-rs
dependencies off pinned git revs and onto published crates.io versions,
matching exactly what dd-trace-rs's datadog-opentelemetry v0.5.2 pins.
Also bumps the serverless-components git rev to pick up its own move to
the same versions.

| crate | before | after |
|---|---|---|
| `datadog-opentelemetry` | git rev `50bfea8` | `0.5.2` |
| `libdd-capabilities` | git rev `72fa868` | `3.0.0` |
| `libdd-common` | git rev `72fa868` | `5.2.0` |
| `libdd-trace-protobuf` | git rev `72fa868` | `4.0.1` |
| `libdd-trace-utils` | git rev `72fa868` | `10.1.0` |
| `libdd-trace-normalization` | git rev `72fa868` | `3.0.1` |
| `libdd-trace-obfuscation` | git rev `72fa868` | `6.0.0` |
| `libdd-trace-stats` | git rev `72fa868` | `7.0.0` |
| `serverless-components` deps | git rev `9daae40` | git rev `3ab0125` |

## Motivation

Bottlecap links both serverless-components and datadog-opentelemetry,
and datadog-opentelemetry itself depends on several libdd-* crates.
Cargo treats a git source as distinct from crates.io and will never
unify them, so pinning our own libdd-* deps to git+libdatadog#72fa868
while datadog-opentelemetry pulled the same crates from crates.io
resolved as two separate copies of each crate even when the code was
identical. Pinning to the same crates.io versions datadog-opentelemetry
v0.5.2 resolves to (confirmed via its Cargo.lock) collapses the libdd-*
deps to one copy each. This was also done in serverless-components in
DataDog/serverless-components#163 to prevent
duplicate dependencies.

## Additional Notes

Three upstream API breaks came with the bump, all in traces:

- `libdd_trace_utils::send_data::Compression` was renamed/moved. It's
now `CompressionStrategy` in `libdd_trace_utils::send_with_retry`, and
its Zstd variant became a struct variant (`Zstd { level }` instead of
`Zstd(level)`). Updated the one call site in trace_processor.rs; no
behavior change.
- `HttpClientCapability` gained `new_without_connection_pooling`.
HttpClient now implements it (http_client.rs) by delegating straight to
`new_client()`, since `create_client` already always disables connection
pooling (pool_max_idle_per_host(0)) to avoid stale connections across
Lambda freeze/resume. Like the pre-existing `new_client`, this
constructor is unreachable on our code path — production always builds
the client via `create_client(...)` directly.
- `SpanConcentrator::new` gained an obfuscation-config argument, gated
on libdd-trace-stats/stats-obfuscation. datadog-opentelemetry pulls that
feature in via libdd-data-pipeline, so feature unification turns it on
for our workspace build even though we don't request it ourselves. We
pass None at both call sites in stats_concentrator_service.rs, which
resolves to the feature's default (obfuscation disabled at the
concentrator level) — the same as before this param existed. Spans are
already obfuscated earlier in the pipeline (obfuscate_span in
trace_processor.rs) before they reach the concentrator, so this
preserves current behavior.

None of these three changes alter runtime behavior. The only intended
behavior change in this PR is the dependency versions themselves moving
forward.

## Describe how to test/QA your changes

- cargo build and cargo build --all-features are clean.
- cargo clippy --all-targets --features default is clean.
- cargo test --lib passes: 650 passed, 0 failed.
- cargo tree --duplicates | grep '^libdd-' is empty — zero duplicate
libdd-* packages remain.
- dd-rust-license-tool write regenerated bottlecap/LICENSE-3rdparty.csv;
dd-rust-license-tool check passes.
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.

4 participants