chore(deps): bump libdatadog to db05e1f and adapt to HttpClientTrait API#1218
Merged
duncanista merged 7 commits intomainfrom May 5, 2026
Merged
Conversation
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bumps libdatadog crates to v32.0.0 and updates bottlecap to accommodate upstream breaking changes, primarily the new capability-based HTTP client trait (HttpClientTrait) and the restructured trace obfuscation configuration.
Changes:
- Update
libdd-*git rev pins to v32.0.0 and add new direct deps (libdd-capabilities,http). - Introduce a wrapped, pre-configured Hyper client that implements
HttpClientTraitto preserve proxy/TLS/skip-SSL behavior. - Replace removed upstream stats-sending helper with an in-module POST helper and migrate obfuscation config to nested structs.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
bottlecap/Cargo.toml |
Bumps libdd-* revs and adds new direct dependencies needed by the v32 API. |
bottlecap/Cargo.lock |
Updates the resolved dependency graph to match the v32 bump and newly introduced crates. |
bottlecap/src/traces/http_client.rs |
Wraps the existing configured Hyper client and implements HttpClientTrait for libdd v32 compatibility. |
bottlecap/src/traces/stats_flusher.rs |
Replaces removed upstream stats sender with a local helper that uses the shared configured client. |
bottlecap/src/bin/bottlecap/main.rs |
Updates construction of ObfuscationConfig to the new nested configuration shape. |
bottlecap/LICENSE-3rdparty.csv |
Regenerates third-party license inventory to reflect updated dependencies. |
libdatadog #1555 replaced raw hyper-client APIs with a HttpClientTrait abstraction. SendData::send and send_with_retry now require H: HttpClientTrait, and stats_utils::send_stats_payload_with_client was removed in favor of a generic that constructs its own client internally. - Wrap the proxy/TLS-aware hyper client in a struct that implements libdd_capabilities::HttpClientTrait so it can be passed to libdd trace senders without losing custom proxy / CA / skip-SSL config. - Inline the stats POST in stats_flusher to keep using the configured HttpClient (preserves Lambda's pool_max_idle_per_host(0) tuning that avoids stale connections after freeze/resume). - Update obfuscation_config::ObfuscationConfig construction for the new nested HttpConfig/MemcachedConfig/RedisConfig layout.
0b25a69 to
8a94026
Compare
- Enforce target.timeout_ms on each stats POST attempt so the retry loop stays bounded by configuration, instead of blocking on a hung connection past the configured flush timeout. - Bound the error-body preview captured from non-202 responses to 512 bytes, fall back to lossy UTF-8 instead of silently emptying on invalid encoding, and include the HTTP status in the error message. - Route HttpClientTrait::new_client through create_client(None, None, false) so the never-invoked fallback shares the same construction path and failure surface as the rest of the module.
lym953
approved these changes
May 4, 2026
Apply the consumer-side pattern from DataDog/libdatadog#1872: libdd-* deps with default-features = false, with explicit https/fips forwarding from bottlecap's own default/fips features. This is the configuration the PR description recommends for downstream consumers. It does not on its own fix the FIPS clippy job, because libdd-trace-stats still pulls libdd-capabilities-impl with default features inside its own Cargo.toml — that path needs an upstream follow-up to #1872 to fully gate.
Contributor
Author
|
Blocked by DataDog/libdatadog#1943 |
…/fips db05e1f is the merge of DataDog/libdatadog#1943 which gates the remaining internal crates that #1872 missed. With those gates in place, bottlecap's `fips` feature can now forward to `libdd-trace-stats/fips` which closes the last path that pulled ring through libdd-capabilities-impl. Verified locally: `cargo clippy --no-default-features --features fips` now reports `No ring dependency found. FIPS compliance check passed`.
3 tasks
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
Bumps the
libdd-*git revs in bottlecap fromc8121f42(~v31.x) todb05e1f8408a76075efb37ecec544d2e74217e57(current libdatadogmain), bumps thedogstatsd/datadog-fipsrevs to5b68f50f49c9defbfed4d25bd621e2a86405a972(current serverless-componentsmain, which already sits on the same libdatadogdb05e1f), and adapts bottlecap to the breaking changes that ship between those revs.What changed and why
Upstream libdatadog changes that motivated this PR
hyperclient API with anHttpClientTraitabstraction.SendData::sendandsend_with_retrynow requireH: HttpClientTrait, andstats_utils::send_stats_payload_with_clientwas removed in favor of a genericsend_stats_payload<H: HttpClientTrait>(…)that constructs its own client.ObfuscationConfigrestructured — flat fields (http_remove_path_digits,obfuscate_memcached, …) replaced with nested per-engine structs (http: HttpConfig,memcached: MemcachedConfig,redis: RedisConfig, plusvalkey,credit_cards,sql,elasticsearch,opensearch,mongodb).ringfor non-fips builds libdatadog#1816 + #1872 + #1943 (crypto provider gating) — movedringbehindlibdd-common/httpsandaws-lc-rsbehindlibdd-common/fips, then progressively gated the internal crates (libdd-trace-utils,libdd-trace-obfuscation,libdd-capabilities-impl,libdd-trace-stats,libdd-data-pipeline,libdd-dogstatsd-client,libdd-telemetry) so downstream consumers can pick exactly one provider. #1943 also added a workspace-wide CI guard in libdatadog that rejects any PR which puts bothringandaws-lc-rsin the dep graph at the same time.Other commits in the range (
c8121f42..db05e1f) are sidecar / FFE / tracer-flare / telemetry changes that don't touch surfaces bottlecap consumes.Code changes in this PR
bottlecap/src/traces/http_client.rs— wrap the client to implementHttpClientTraitThe bottlecap HTTP client must keep proxy + custom CA + skip-SSL support (FIPS,
DD_PROXY_HTTPS,DD_TLS_CERT_FILE,DD_SKIP_SSL_VALIDATION). The upstreamDefaultHttpClientfromlibdd-capabilities-implhardcodesConnector::default()and supports none of those — using it would be a regression.So
HttpClientis now a newtype aroundGenericHttpClient<ProxyConnector<Connector>>that implementslibdd_capabilities::HttpClientTrait. The trait'srequest()mapshttp::Request<Bytes>→Body::from_bytes(…)→ hyper request, then collects the response body back toBytes. ~30 lines, reuses libdatadog's encoding/retry/header logic.HttpClientTrait::new_client()is required by the trait but doesn't fit our model (we need a configured client, not a default). It now routes throughcreate_client(None, None, false)so the failure surface is consistent with the rest of the module — and it's never invoked on production paths (we always go throughcreate_client(proxy, tls_cert, skip_ssl)).bottlecap/src/traces/stats_flusher.rs— inline the stats POSTThe new
send_stats_payload<H: HttpClientTrait>(data, target, api_key)callsH::new_client()internally — meaning callers can't supply a pre-configured client anymore. That would lose Lambda'spool_max_idle_per_host(0)tuning, which exists specifically to avoid stale connections after Lambda freeze/resume cycles.Replaced the removed call with a tiny in-module
send_stats_payloadhelper that builds the same POST request (msgpack + gzip +DD-API-KEY) and invokes ourHttpClient'srequest()method directly. Per Copilot review: each attempt is wrapped intokio::time::timeout(target.timeout_ms, …)so the retry loop stays bounded by config, and the error-body capture is bounded to 512 bytes (lossy UTF-8) with the HTTP status surfaced in the message instead of silently emptying on non-UTF8 responses.bottlecap/src/bin/bottlecap/main.rs— flatten → nestedObfuscationConfigMaps the two HTTP fields we configure (
apm_config_obfuscation_http_remove_paths_with_digits,apm_config_obfuscation_http_remove_query_string) into the newHttpConfig. Everything else flows through..Default::default(), which preserves the previous behavior (memcached/redis disabled).bottlecap/Cargo.toml+bottlecap/Cargo.locklibdd-*revs todb05e1fanddogstatsd/datadog-fipsrevs to5b68f50(serverless-componentsmain).libdd-capabilities(source ofHttpClientTrait) andhttp(now used directly instats_flusher) as direct dependencies.default-features = falseon alllibdd-*deps and forwardslibdd-*/httpsfrom bottlecap'sdefaultfeature andlibdd-*/fipsfrom bottlecap'sfipsfeature — the consumer-side pattern that #1872's description prescribed.bottlecap/LICENSE-3rdparty.csvRegenerated via
dd-rust-license-tool writeto include the newlibdd-capabilities/libdd-capabilities-impl/libdd-shared-runtime/httpentries.FIPS
Previously a known issue — the FIPS clippy job failed because
libdd-trace-stats(andlibdd-data-pipeline) pulledlibdd-capabilities-implwith default features =https = ring, with no downstream-side workaround possible. DataDog/libdatadog#1943 fixed this upstream, and this PR now forwardslibdd-trace-stats/fipsfrom thefipsfeature.Verified locally:
Companion PRs (already merged)
dogstatsd/datadog-fipssource workspace to libdatadogdb05e1f. This PR pins to its merge SHA5b68f50, so the whole chain (libdatadog → serverless-components → bottlecap) sits on a consistent baseline.Test plan
cargo check --all-targets(default features)cargo clippy --workspace --all-targets --features defaultcargo clippy --workspace --all-targets --no-default-features --features fips— FIPS dependency check now passes locally (was the long-standing CI blocker)cargo test --no-runcargo fmt --all -- --checkARCHITECTURE=arm64 FIPS=false ./scripts/build_bottlecap_layer.sh— built successfully, binary 11.17 MiB stripped / layer zip 5.08 MiB (slightly smaller thanorigin/main's 11.23 MiB / 5.11 MiB)