Skip to content

fix(trace-stats): read OTel HTTP names for the status and method dimensions - #2323

Draft
link04 wants to merge 9 commits into
mainfrom
maximo/otel-semantics-tags
Draft

fix(trace-stats): read OTel HTTP names for the status and method dimensions#2323
link04 wants to merge 9 commits into
mainfrom
maximo/otel-semantics-tags

Conversation

@link04

@link04 link04 commented Aug 5, 2026

Copy link
Copy Markdown

What does this PR do?

Preserves OpenTelemetry HTTP semantics in libdatadog's in-process consumers and OTLP output.

Trace stats and OTLP trace metrics

  • reads canonical Datadog HTTP method/status keys first, then falls back to http.request.method and http.response.status_code
  • accepts valid numeric or string status values without allowing empty, malformed, non-finite, or non-integral values to shadow a valid fallback
  • emits OTel trace-metric dimensions for method, status, route, span name, and kind
  • leaves successful status.code unset and prevents additional tags from overriding the computed status

HTTP tag handling

libdatadog does not rename tracer span tags in this PR. It accepts the Datadog and OpenTelemetry names below as equivalent inputs to trace-stat aggregation and emits the canonical OpenTelemetry name in OTLP trace metrics.

Concept Datadog span input OpenTelemetry span input OTLP trace-metric output
HTTP method http.method http.request.method http.request.method
HTTP response status http.status_code http.response.status_code http.response.status_code as an integer
Span error status Span error flag Span error flag status.code=STATUS_CODE_ERROR for errors; omitted for successful spans

When both naming variants are present, the Datadog name wins. Empty or malformed values fall through to the alternate name instead of hiding a valid value.

OTLP sampled flags

Sampling priority is a trace-level decision, but v0.4/v0.5 inputs may attach _sampling_priority_v1 to only one span. The mapper now uses the same first-priority policy as drop_chunks, treats a missing priority as sampled, and applies one decision to every span in the chunk.

This prevents sampled traces from exporting child spans with flags=0 and keeps OTLP flags consistent with the existing chunk-retention policy.

No public signature, wire-format, setting, or environment-variable change is introduced.

Motivation

Under DD_TRACE_OTEL_SEMANTICS_ENABLED, spans use OTel HTTP names before client-side stats are computed. Stats and OTLP metrics must preserve those dimensions, and all spans in an exported trace must carry the same sampled decision.

Companion changes:

Testing

  • cargo fmt --check -p libdd-trace-utils
  • mapper unit tests: 31 passed
  • OTLP trace-exporter integration tests: 3 passed
  • trace-stats tests: 43 passed

End-to-end with the companion tracer and system-test changes:

Scenario Result
OTEL_SEMANTICS_OTLP_TRACE_METRICS 4 passed
OTEL_SEMANTICS_OTLP_SAMPLING_RULES 2 passed

@pr-commenter

pr-commenter Bot commented Aug 5, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Benchmark execution time: 2026-08-19 18:48:54

Comparing candidate commit 5cc262f in PR branch maximo/otel-semantics-tags with baseline commit 1765c7c in branch main.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 137 metrics, 0 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:credit_card/is_card_number/378282246310005

  • 🟥 execution_time [+10.107µs; +10.215µs] or [+14.304%; +14.457%]
  • 🟥 throughput [-1789242.376op/s; -1769854.758op/s] or [-12.642%; -12.505%]

Benchmark execution time: 2026-08-19 18:45:15

Comparing candidate commit 5cc262f in PR branch maximo/otel-semantics-tags with baseline commit 1765c7c in branch main.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 72 metrics, 10 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:glob_matcher/unicode_pattern_ascii_subject/wall_time

  • 🟥 execution_time [+11.708ns; +11.843ns] or [+12.882%; +13.031%]

scenario:trace_buffer/4_senders/no_delay

  • 🟥 execution_time [+143.788µs; +173.430µs] or [+6.127%; +7.391%]
  • 🟥 throughput [-108390.704op/s; -89339.285op/s] or [-7.054%; -5.814%]

Candidate

Omitted due to size.

Baseline

Omitted due to size.

@dd-octo-sts

dd-octo-sts Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.20 MB 8.20 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 89.47 MB 89.48 MB +.01% (+9.77 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.06 MB 11.06 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.65 MB 100.66 MB +.01% (+10.64 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.62 MB 26.63 MB +.01% (+4.50 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 180.69 MB 180.70 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 772.58 MB 771.82 MB --.09% (-775.18 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.72 MB 8.72 MB --.06% (-5.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.64 MB 25.64 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.06 MB 51.06 MB -0% (-2.93 KB) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.20 MB 23.21 MB +.01% (+3.50 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 185.61 MB 185.62 MB +0% (+8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 759.08 MB 759.74 MB +.08% (+673.48 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.74 MB 6.74 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.58 MB 27.58 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.60 MB 48.60 MB +0% (+2.47 KB) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.74 MB 79.75 MB +.01% (+8.42 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.15 MB 9.15 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.38 MB 95.39 MB +0% (+8.49 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.16 MB 11.17 MB +.03% (+4.00 KB) 🔍

link04 and others added 2 commits August 6, 2026 11:06
…nsions

The stats aggregation key reads http.status_code and http.method only. A tracer
running with DD_TRACE_OTEL_SEMANTICS_ENABLED emits http.response.status_code and
http.request.method instead, so both dimensions silently collapse: HTTPStatusCode
becomes 0 and HTTPMethod becomes empty, for every HTTP span, with no error
anywhere. The span still reports its status correctly, so the span and the stats
disagree and nothing at span level can see it.

Both names are now read, Datadog first so a span using Datadog naming still costs
a single lookup and a tracer emitting both during a migration keeps the dimension
it already reports. The status code is looked up in metrics as well as meta under
the OTel name, because OTel types it as an int and the v04 encoder routes int
attributes to metrics.

http.endpoint and http.route need no equivalent. http.route is already the OTel
name, and http.endpoint is Datadog-only and deliberately retained in that mode.

Not gated on the otel_trace_semantics_enabled flag in libdd-data-pipeline: that
flag is not plumbed into libdd-trace-stats, and threading it in would mean a
breaking change to SpanConcentrator::new. The two names cannot legitimately
disagree, so reading both unconditionally is safe.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Review follow-up on the two lookups added in the previous commit.

An empty or unparseable value under the Datadog name terminated the search at
the default instead of falling through, so meta["http.status_code"] = "" next to
a valid http.response.status_code produced a bucket with status 0, which is the
same span/stats disagreement this branch set out to fix. Same for an empty
http.method shadowing http.request.method, because or_else only fires on None.
Both lookups now skip a value that is empty or does not parse, matching what
get_grpc_status_code in the same file already does.

Also drops the claim that the v04 encoder is what routes the OTel status code
into metrics. The concentrator runs before serialization, so the split is
whatever the tracer's own setter did.

Three cases added: Datadog name in meta against OTel name in metrics, an
unparseable Datadog status with a valid OTel one, and an empty Datadog method.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@link04
link04 force-pushed the maximo/otel-semantics-tags branch from a142769 to a8e29fd Compare August 6, 2026 15:07
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation Check Results

⚠️ 2950 documentation warning(s) found

📦 libdd-data-pipeline - 1282 warning(s)

📦 libdd-trace-stats - 904 warning(s)

📦 libdd-trace-utils - 764 warning(s)


Updated: 2026-08-24 04:39:33 UTC | Commit: 017402e | missing-docs job results

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.71% (+0.23%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: db0d19b | Docs | View more details | Give us feedback!

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🔒 Cargo Deny Results

⚠️ 10 issue(s) found, showing only errors (advisories, bans, sources)

📦 libdd-data-pipeline - 4 error(s)

Show output
error[vulnerability]: Invalid pointer dereference in `fmt::Pointer` impl for `Atomic` and `Shared` when the underlying pointer is invalid
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:77:1
   │
77 │ crossbeam-epoch 0.9.18 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0204
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0204
   ├ Affected versions of `fmt::Display` dereference the underlying pointer. This causes a invalid pointer dereference e.g., when a pointer created with `Atomic::null` or `Shared::null`. `fmt::Debug` impls and pre-0.9 `fmt::Display` impls, which do not dereference pointers, are not affected by this issue.
   ├ Announcement: https://github.com/crossbeam-rs/crossbeam/pull/1276
   ├ Solution: Upgrade to >=0.9.20 (try `cargo update -p crossbeam-epoch`)
   ├ crossbeam-epoch v0.9.18
     └── crossbeam-deque v0.8.5
         └── rayon-core v1.12.1
             └── rayon v1.10.0
                 └── criterion v0.5.1
                     ├── libdd-common v5.2.0
                     │   ├── libdd-capabilities-impl v4.0.0
                     │   │   ├── libdd-data-pipeline v8.0.0
                     │   │   ├── libdd-shared-runtime v3.0.0
                     │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
                     │   │   │   ├── libdd-dogstatsd-client v5.0.0
                     │   │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
                     │   │   │   │   └── libdd-trace-stats v7.0.0
                     │   │   │   │       └── libdd-data-pipeline v8.0.0 (*)
                     │   │   │   ├── libdd-telemetry v7.0.0
                     │   │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
                     │   │   │   │   └── libdd-trace-stats v7.0.0 (*)
                     │   │   │   └── libdd-trace-stats v7.0.0 (*)
                     │   │   ├── (dev) libdd-telemetry v7.0.0 (*)
                     │   │   ├── libdd-trace-stats v7.0.0 (*)
                     │   │   └── libdd-trace-utils v10.1.0
                     │   │       ├── libdd-data-pipeline v8.0.0 (*)
                     │   │       ├── libdd-trace-obfuscation v6.0.0
                     │   │       │   └── libdd-trace-stats v7.0.0 (*)
                     │   │       ├── libdd-trace-stats v7.0.0 (*)
                     │   │       └── (dev) libdd-trace-utils v10.1.0 (*)
                     │   ├── libdd-data-pipeline v8.0.0 (*)
                     │   ├── libdd-dogstatsd-client v5.0.0 (*)
                     │   ├── libdd-shared-runtime v3.0.0 (*)
                     │   ├── libdd-telemetry v7.0.0 (*)
                     │   ├── libdd-trace-obfuscation v6.0.0 (*)
                     │   ├── libdd-trace-stats v7.0.0 (*)
                     │   └── libdd-trace-utils v10.1.0 (*)
                     ├── (dev) libdd-data-pipeline v8.0.0 (*)
                     ├── (dev) libdd-ddsketch v1.1.1
                     │   ├── libdd-data-pipeline v8.0.0 (*)
                     │   ├── libdd-telemetry v7.0.0 (*)
                     │   └── libdd-trace-stats v7.0.0 (*)
                     ├── (dev) libdd-trace-normalization v3.0.1
                     │   ├── libdd-data-pipeline v8.0.0 (*)
                     │   └── libdd-trace-utils v10.1.0 (*)
                     ├── (dev) libdd-trace-obfuscation v6.0.0 (*)
                     ├── (dev) libdd-trace-stats v7.0.0 (*)
                     └── (dev) libdd-trace-utils v10.1.0 (*)

error[vulnerability]: h2 unbounded empty DATA frames
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:117:1
    │
117 │ h2 0.4.6 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2026-0258
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0258
    ├ The h2 crate, used internally by hyper, had a flaw that would accept and queue empty DATA frames without limit.
      If streams were not actively drained, this could lead to unbounded memory usage, or a panic if the length overflows.
      
      Low severity.
      
      Patched in v0.4.16.
    ├ Announcement: https://github.com/hyperium/hyper/security/advisories/GHSA-q83h-524g-xf6h
    ├ Solution: Upgrade to >=0.4.16 (try `cargo update -p h2`)
    ├ h2 v0.4.6
      └── hyper v1.6.0
          ├── httpmock v0.8.0-alpha.1
          │   ├── (dev) libdd-data-pipeline v8.0.0
          │   ├── (dev) libdd-telemetry v7.0.0
          │   │   ├── libdd-data-pipeline v8.0.0 (*)
          │   │   └── libdd-trace-stats v7.0.0
          │   │       └── libdd-data-pipeline v8.0.0 (*)
          │   ├── (dev) libdd-trace-stats v7.0.0 (*)
          │   └── libdd-trace-utils v10.1.0
          │       ├── libdd-data-pipeline v8.0.0 (*)
          │       ├── libdd-trace-obfuscation v6.0.0
          │       │   └── libdd-trace-stats v7.0.0 (*)
          │       ├── libdd-trace-stats v7.0.0 (*)
          │       └── (dev) libdd-trace-utils v10.1.0 (*)
          ├── hyper-rustls v0.27.7
          │   └── libdd-common v5.2.0
          │       ├── libdd-capabilities-impl v4.0.0
          │       │   ├── libdd-data-pipeline v8.0.0 (*)
          │       │   ├── libdd-shared-runtime v3.0.0
          │       │   │   ├── libdd-data-pipeline v8.0.0 (*)
          │       │   │   ├── libdd-dogstatsd-client v5.0.0
          │       │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
          │       │   │   │   └── libdd-trace-stats v7.0.0 (*)
          │       │   │   ├── libdd-telemetry v7.0.0 (*)
          │       │   │   └── libdd-trace-stats v7.0.0 (*)
          │       │   ├── (dev) libdd-telemetry v7.0.0 (*)
          │       │   ├── libdd-trace-stats v7.0.0 (*)
          │       │   └── libdd-trace-utils v10.1.0 (*)
          │       ├── libdd-data-pipeline v8.0.0 (*)
          │       ├── libdd-dogstatsd-client v5.0.0 (*)
          │       ├── libdd-shared-runtime v3.0.0 (*)
          │       ├── libdd-telemetry v7.0.0 (*)
          │       ├── libdd-trace-obfuscation v6.0.0 (*)
          │       ├── libdd-trace-stats v7.0.0 (*)
          │       └── libdd-trace-utils v10.1.0 (*)
          ├── hyper-util v0.1.17
          │   ├── httpmock v0.8.0-alpha.1 (*)
          │   ├── hyper-rustls v0.27.7 (*)
          │   └── libdd-common v5.2.0 (*)
          ├── libdd-common v5.2.0 (*)
          └── libdd-trace-utils v10.1.0 (*)

error[unsound]: Rand is unsound with a custom logger using `rand::rng()`
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:223:1
    │
223 │ rand 0.8.5 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
    │
    ├ ID: RUSTSEC-2026-0097
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0097
    ├ It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
      
      - The `log` and `thread_rng` features are enabled
      - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined
      - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`
      - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
      - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed
      
      `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.
    ├ Announcement: https://github.com/rust-random/rand/pull/1763
    ├ Solution: Upgrade to >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 (try `cargo update -p rand`)
    ├ rand v0.8.5
      ├── libdd-common v5.2.0
      │   ├── libdd-capabilities-impl v4.0.0
      │   │   ├── libdd-data-pipeline v8.0.0
      │   │   ├── libdd-shared-runtime v3.0.0
      │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
      │   │   │   ├── libdd-dogstatsd-client v5.0.0
      │   │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
      │   │   │   │   └── libdd-trace-stats v7.0.0
      │   │   │   │       └── libdd-data-pipeline v8.0.0 (*)
      │   │   │   ├── libdd-telemetry v7.0.0
      │   │   │   │   ├── libdd-data-pipeline v8.0.0 (*)
      │   │   │   │   └── libdd-trace-stats v7.0.0 (*)
      │   │   │   └── libdd-trace-stats v7.0.0 (*)
      │   │   ├── (dev) libdd-telemetry v7.0.0 (*)
      │   │   ├── libdd-trace-stats v7.0.0 (*)
      │   │   └── libdd-trace-utils v10.1.0
      │   │       ├── libdd-data-pipeline v8.0.0 (*)
      │   │       ├── libdd-trace-obfuscation v6.0.0
      │   │       │   └── libdd-trace-stats v7.0.0 (*)
      │   │       ├── libdd-trace-stats v7.0.0 (*)
      │   │       └── (dev) libdd-trace-utils v10.1.0 (*)
      │   ├── libdd-data-pipeline v8.0.0 (*)
      │   ├── libdd-dogstatsd-client v5.0.0 (*)
      │   ├── libdd-shared-runtime v3.0.0 (*)
      │   ├── libdd-telemetry v7.0.0 (*)
      │   ├── libdd-trace-obfuscation v6.0.0 (*)
      │   ├── libdd-trace-stats v7.0.0 (*)
      │   └── libdd-trace-utils v10.1.0 (*)
      ├── (dev) libdd-data-pipeline v8.0.0 (*)
      ├── (dev) libdd-ddsketch v1.1.1
      │   ├── libdd-data-pipeline v8.0.0 (*)
      │   ├── libdd-telemetry v7.0.0 (*)
      │   └── libdd-trace-stats v7.0.0 (*)
      ├── (dev) libdd-trace-normalization v3.0.1
      │   ├── libdd-data-pipeline v8.0.0 (*)
      │   └── libdd-trace-utils v10.1.0 (*)
      ├── (dev) libdd-trace-stats v7.0.0 (*)
      ├── libdd-trace-utils v10.1.0 (*)
      └── proptest v1.5.0
          ├── (dev) libdd-common v5.2.0 (*)
          └── (dev) libdd-tinybytes v1.1.2
              ├── libdd-data-pipeline v8.0.0 (*)
              ├── (dev) libdd-tinybytes v1.1.2 (*)
              └── libdd-trace-utils v10.1.0 (*)

error[vulnerability]: Denial of Service via Stack Exhaustion
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:295:1
    │
295 │ time 0.3.41 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2026-0009
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0009
    ├ ## Impact
      
      When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of
      service attack via stack exhaustion is possible. The attack relies on formally deprecated and
      rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary,
      non-malicious input will never encounter this scenario.
      
      ## Patches
      
      A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned
      rather than exhausting the stack.
      
      ## Workarounds
      
      Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of
      the stack consumed would be at most a factor of the length of the input.
    ├ Announcement: https://github.com/time-rs/time/blob/main/CHANGELOG.md#0347-2026-02-05
    ├ Solution: Upgrade to >=0.3.47 (try `cargo update -p time`)
    ├ time v0.3.41
      └── tracing-appender v0.2.3
          └── libdd-log v1.0.0
              └── (dev) libdd-data-pipeline v8.0.0

advisories FAILED, bans ok, sources ok

📦 libdd-trace-stats - 3 error(s)

Show output
error[vulnerability]: Invalid pointer dereference in `fmt::Pointer` impl for `Atomic` and `Shared` when the underlying pointer is invalid
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:68:1
   │
68 │ crossbeam-epoch 0.9.18 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0204
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0204
   ├ Affected versions of `fmt::Display` dereference the underlying pointer. This causes a invalid pointer dereference e.g., when a pointer created with `Atomic::null` or `Shared::null`. `fmt::Debug` impls and pre-0.9 `fmt::Display` impls, which do not dereference pointers, are not affected by this issue.
   ├ Announcement: https://github.com/crossbeam-rs/crossbeam/pull/1276
   ├ Solution: Upgrade to >=0.9.20 (try `cargo update -p crossbeam-epoch`)
   ├ crossbeam-epoch v0.9.18
     └── crossbeam-deque v0.8.5
         └── rayon-core v1.12.1
             └── rayon v1.10.0
                 └── criterion v0.5.1
                     ├── libdd-common v5.2.0
                     │   ├── libdd-capabilities-impl v4.0.0
                     │   │   ├── libdd-shared-runtime v3.0.0
                     │   │   │   ├── libdd-telemetry v7.0.0
                     │   │   │   │   └── libdd-trace-stats v7.0.0
                     │   │   │   └── libdd-trace-stats v7.0.0 (*)
                     │   │   ├── (dev) libdd-telemetry v7.0.0 (*)
                     │   │   ├── libdd-trace-stats v7.0.0 (*)
                     │   │   └── libdd-trace-utils v10.1.0
                     │   │       ├── libdd-trace-obfuscation v6.0.0
                     │   │       │   └── libdd-trace-stats v7.0.0 (*)
                     │   │       ├── libdd-trace-stats v7.0.0 (*)
                     │   │       └── (dev) libdd-trace-utils v10.1.0 (*)
                     │   ├── libdd-dogstatsd-client v5.0.0
                     │   │   └── libdd-trace-stats v7.0.0 (*)
                     │   ├── libdd-shared-runtime v3.0.0 (*)
                     │   ├── libdd-telemetry v7.0.0 (*)
                     │   ├── libdd-trace-obfuscation v6.0.0 (*)
                     │   ├── libdd-trace-stats v7.0.0 (*)
                     │   └── libdd-trace-utils v10.1.0 (*)
                     ├── (dev) libdd-ddsketch v1.1.1
                     │   ├── libdd-telemetry v7.0.0 (*)
                     │   └── libdd-trace-stats v7.0.0 (*)
                     ├── (dev) libdd-trace-normalization v3.0.1
                     │   └── libdd-trace-utils v10.1.0 (*)
                     ├── (dev) libdd-trace-obfuscation v6.0.0 (*)
                     ├── (dev) libdd-trace-stats v7.0.0 (*)
                     └── (dev) libdd-trace-utils v10.1.0 (*)

error[vulnerability]: h2 unbounded empty DATA frames
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:106:1
    │
106 │ h2 0.4.6 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2026-0258
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0258
    ├ The h2 crate, used internally by hyper, had a flaw that would accept and queue empty DATA frames without limit.
      If streams were not actively drained, this could lead to unbounded memory usage, or a panic if the length overflows.
      
      Low severity.
      
      Patched in v0.4.16.
    ├ Announcement: https://github.com/hyperium/hyper/security/advisories/GHSA-q83h-524g-xf6h
    ├ Solution: Upgrade to >=0.4.16 (try `cargo update -p h2`)
    ├ h2 v0.4.6
      └── hyper v1.6.0
          ├── httpmock v0.8.0-alpha.1
          │   ├── (dev) libdd-telemetry v7.0.0
          │   │   └── libdd-trace-stats v7.0.0
          │   ├── (dev) libdd-trace-stats v7.0.0 (*)
          │   └── libdd-trace-utils v10.1.0
          │       ├── libdd-trace-obfuscation v6.0.0
          │       │   └── libdd-trace-stats v7.0.0 (*)
          │       ├── libdd-trace-stats v7.0.0 (*)
          │       └── (dev) libdd-trace-utils v10.1.0 (*)
          ├── hyper-rustls v0.27.7
          │   └── libdd-common v5.2.0
          │       ├── libdd-capabilities-impl v4.0.0
          │       │   ├── libdd-shared-runtime v3.0.0
          │       │   │   ├── libdd-telemetry v7.0.0 (*)
          │       │   │   └── libdd-trace-stats v7.0.0 (*)
          │       │   ├── (dev) libdd-telemetry v7.0.0 (*)
          │       │   ├── libdd-trace-stats v7.0.0 (*)
          │       │   └── libdd-trace-utils v10.1.0 (*)
          │       ├── libdd-dogstatsd-client v5.0.0
          │       │   └── libdd-trace-stats v7.0.0 (*)
          │       ├── libdd-shared-runtime v3.0.0 (*)
          │       ├── libdd-telemetry v7.0.0 (*)
          │       ├── libdd-trace-obfuscation v6.0.0 (*)
          │       ├── libdd-trace-stats v7.0.0 (*)
          │       └── libdd-trace-utils v10.1.0 (*)
          ├── hyper-util v0.1.17
          │   ├── httpmock v0.8.0-alpha.1 (*)
          │   ├── hyper-rustls v0.27.7 (*)
          │   └── libdd-common v5.2.0 (*)
          ├── libdd-common v5.2.0 (*)
          └── libdd-trace-utils v10.1.0 (*)

error[unsound]: Rand is unsound with a custom logger using `rand::rng()`
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:202:1
    │
202 │ rand 0.8.5 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
    │
    ├ ID: RUSTSEC-2026-0097
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0097
    ├ It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
      
      - The `log` and `thread_rng` features are enabled
      - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined
      - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`
      - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
      - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed
      
      `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.
    ├ Announcement: https://github.com/rust-random/rand/pull/1763
    ├ Solution: Upgrade to >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 (try `cargo update -p rand`)
    ├ rand v0.8.5
      ├── libdd-common v5.2.0
      │   ├── libdd-capabilities-impl v4.0.0
      │   │   ├── libdd-shared-runtime v3.0.0
      │   │   │   ├── libdd-telemetry v7.0.0
      │   │   │   │   └── libdd-trace-stats v7.0.0
      │   │   │   └── libdd-trace-stats v7.0.0 (*)
      │   │   ├── (dev) libdd-telemetry v7.0.0 (*)
      │   │   ├── libdd-trace-stats v7.0.0 (*)
      │   │   └── libdd-trace-utils v10.1.0
      │   │       ├── libdd-trace-obfuscation v6.0.0
      │   │       │   └── libdd-trace-stats v7.0.0 (*)
      │   │       ├── libdd-trace-stats v7.0.0 (*)
      │   │       └── (dev) libdd-trace-utils v10.1.0 (*)
      │   ├── libdd-dogstatsd-client v5.0.0
      │   │   └── libdd-trace-stats v7.0.0 (*)
      │   ├── libdd-shared-runtime v3.0.0 (*)
      │   ├── libdd-telemetry v7.0.0 (*)
      │   ├── libdd-trace-obfuscation v6.0.0 (*)
      │   ├── libdd-trace-stats v7.0.0 (*)
      │   └── libdd-trace-utils v10.1.0 (*)
      ├── (dev) libdd-ddsketch v1.1.1
      │   ├── libdd-telemetry v7.0.0 (*)
      │   └── libdd-trace-stats v7.0.0 (*)
      ├── (dev) libdd-trace-normalization v3.0.1
      │   └── libdd-trace-utils v10.1.0 (*)
      ├── (dev) libdd-trace-stats v7.0.0 (*)
      ├── libdd-trace-utils v10.1.0 (*)
      └── proptest v1.5.0
          ├── (dev) libdd-common v5.2.0 (*)
          └── (dev) libdd-tinybytes v1.1.2
              ├── (dev) libdd-tinybytes v1.1.2 (*)
              └── libdd-trace-utils v10.1.0 (*)

advisories FAILED, bans ok, sources ok

📦 libdd-trace-utils - 3 error(s)

Show output
error[vulnerability]: Invalid pointer dereference in `fmt::Pointer` impl for `Atomic` and `Shared` when the underlying pointer is invalid
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:63:1
   │
63 │ crossbeam-epoch 0.9.18 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0204
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0204
   ├ Affected versions of `fmt::Display` dereference the underlying pointer. This causes a invalid pointer dereference e.g., when a pointer created with `Atomic::null` or `Shared::null`. `fmt::Debug` impls and pre-0.9 `fmt::Display` impls, which do not dereference pointers, are not affected by this issue.
   ├ Announcement: https://github.com/crossbeam-rs/crossbeam/pull/1276
   ├ Solution: Upgrade to >=0.9.20 (try `cargo update -p crossbeam-epoch`)
   ├ crossbeam-epoch v0.9.18
     └── crossbeam-deque v0.8.5
         └── rayon-core v1.12.1
             └── rayon v1.10.0
                 └── criterion v0.5.1
                     ├── libdd-common v5.2.0
                     │   ├── libdd-capabilities-impl v4.0.0
                     │   │   └── libdd-trace-utils v10.1.0
                     │   │       └── (dev) libdd-trace-utils v10.1.0 (*)
                     │   └── libdd-trace-utils v10.1.0 (*)
                     ├── (dev) libdd-trace-normalization v3.0.1
                     │   └── libdd-trace-utils v10.1.0 (*)
                     └── (dev) libdd-trace-utils v10.1.0 (*)

error[vulnerability]: h2 unbounded empty DATA frames
   ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:97:1
   │
97 │ h2 0.4.6 registry+https://github.com/rust-lang/crates.io-index
   │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
   │
   ├ ID: RUSTSEC-2026-0258
   ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0258
   ├ The h2 crate, used internally by hyper, had a flaw that would accept and queue empty DATA frames without limit.
     If streams were not actively drained, this could lead to unbounded memory usage, or a panic if the length overflows.
     
     Low severity.
     
     Patched in v0.4.16.
   ├ Announcement: https://github.com/hyperium/hyper/security/advisories/GHSA-q83h-524g-xf6h
   ├ Solution: Upgrade to >=0.4.16 (try `cargo update -p h2`)
   ├ h2 v0.4.6
     └── hyper v1.6.0
         ├── httpmock v0.8.0-alpha.1
         │   └── libdd-trace-utils v10.1.0
         │       └── (dev) libdd-trace-utils v10.1.0 (*)
         ├── hyper-rustls v0.27.7
         │   └── libdd-common v5.2.0
         │       ├── libdd-capabilities-impl v4.0.0
         │       │   └── libdd-trace-utils v10.1.0 (*)
         │       └── libdd-trace-utils v10.1.0 (*)
         ├── hyper-util v0.1.17
         │   ├── httpmock v0.8.0-alpha.1 (*)
         │   ├── hyper-rustls v0.27.7 (*)
         │   └── libdd-common v5.2.0 (*)
         ├── libdd-common v5.2.0 (*)
         └── libdd-trace-utils v10.1.0 (*)

error[unsound]: Rand is unsound with a custom logger using `rand::rng()`
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:184:1
    │
184 │ rand 0.8.5 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ unsound advisory detected
    │
    ├ ID: RUSTSEC-2026-0097
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0097
    ├ It has been reported (by [@lopopolo](https://github.com/lopopolo)) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:
      
      - The `log` and `thread_rng` features are enabled
      - A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined
      - The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`
      - The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)
      - Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed
      
      `TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.
    ├ Announcement: https://github.com/rust-random/rand/pull/1763
    ├ Solution: Upgrade to >=0.10.1 OR <0.10.0, >=0.9.3 OR <0.9.0, >=0.8.6 (try `cargo update -p rand`)
    ├ rand v0.8.5
      ├── (dev) libdd-common v5.2.0
      │   ├── libdd-capabilities-impl v4.0.0
      │   │   └── libdd-trace-utils v10.1.0
      │   │       └── (dev) libdd-trace-utils v10.1.0 (*)
      │   └── libdd-trace-utils v10.1.0 (*)
      ├── (dev) libdd-trace-normalization v3.0.1
      │   └── libdd-trace-utils v10.1.0 (*)
      ├── libdd-trace-utils v10.1.0 (*)
      └── proptest v1.5.0
          ├── (dev) libdd-common v5.2.0 (*)
          └── (dev) libdd-tinybytes v1.1.2
              ├── (dev) libdd-tinybytes v1.1.2 (*)
              └── libdd-trace-utils v10.1.0 (*)

advisories FAILED, bans ok, sources ok

Updated: 2026-08-24 04:41:10 UTC | Commit: 017402e | dependency-check job results

link04 and others added 2 commits August 13, 2026 17:44
Use Agent-compatible HTTP aliases and reject malformed status values so OTLP trace metrics preserve valid dimensions and leave successful status unset.

Co-authored-by: Cursor <cursoragent@cursor.com>
link04 and others added 2 commits August 13, 2026 22:40
Reject malformed numeric HTTP statuses so valid fallbacks remain usable, and leave successful OTLP trace metrics with the unset status required by OTel semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve the trace-level sampling decision once and apply it to every exported OTLP span for both supported input formats.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use the same first-priority decision as chunk dropping so every exported OTLP span carries a consistent sampled flag.

Co-authored-by: Cursor <cursoragent@cursor.com>
@link04
link04 marked this pull request as ready for review August 18, 2026 18:21
@link04
link04 requested review from a team as code owners August 18, 2026 18:21
@link04
link04 requested review from vpellan and removed request for a team August 18, 2026 18:21
…-tags

# Conflicts:
#	libdd-data-pipeline/tests/test_trace_exporter_otlp_export.rs
@link04
link04 marked this pull request as draft August 20, 2026 15:50
`status.code` is a dimension of the metric, not a span status, so omitting it on
success does not mean "unset": it gives successful and error cells different
attribute sets, and a consumer grouping by `status.code` loses the OK series
entirely. Restore the value 9c7a650 dropped, so every data point carries
either STATUS_CODE_OK or STATUS_CODE_ERROR.

The two tests that were changed to expect no attribute now expect
STATUS_CODE_OK and assert it appears exactly once. The guard that stops
`additional_metric_tags` from supplying its own `status.code` stays, as do the
HTTP alias parsing and malformed-status handling from the same commit. Spans are
untouched, so a successful span still exports with status UNSET.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@ichinaski ichinaski left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changes regarding the OTel tags for method and status_code extraction look good.

for tag in &group.additional_metric_tags {
if let Some((k, v)) = tag.split_once(':') {
if attrs.iter().all(|attr| attr["key"].as_str() != Some(k)) {
if k != "status.code" && attrs.iter().all(|attr| attr["key"].as_str() != Some(k)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

On line 192 we have

attrs.push(kv_str(
        "status.code",
        if is_error {
            STATUS_CODE_ERROR
        } else {
            STATUS_CODE_OK
        },
    ));

isn't this change dead code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants