Skip to content

Read only the priority and parent id from a lower-priority W3C tracestate - #13650

Draft
dougqh wants to merge 1 commit into
dougqh/tracestate-tablesfrom
dougqh/tracestate-lower-priority-merge
Draft

dougqh wants to merge 1 commit into
dougqh/tracestate-tablesfrom
dougqh/tracestate-lower-priority-merge

Conversation

@dougqh

@dougqh dougqh commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

When a W3C trace context is merged into a context a higher-priority style already extracted (Datadog, in the default datadog,tracecontext,baggage order), the merge now reads only the sampling priority (s:) and last parent id (p:) from the tracestate's dd member, and skips that member's other elements.

Stacked on #13610.

Motivation

The merge uses only those two elements: the higher-priority context has its own Datadog tags. On a Kafka consumer receiving records from a Datadog producer (which writes both styles), merging the W3C context is the largest remaining extraction cost, and most of that was parsing the rest of the dd member.

Additional Notes

🤖 Generated with Claude Code

…'s dd member

When a higher-priority style (Datadog, by default) has extracted the context, a
W3C trace context is merged into it, and the merge uses only the sampling
priority and last parent id of the tracestate's dd member: the context has its
own Datadog tags. The merge's parse still checked the member's other elements,
and a malformed trace id or decision maker tag there discarded the tracestate,
or its priority and parent id.

The merge now reads only the s: and p: elements, each validated as before, and
skips the others. Every member is still validated, so a malformed tracestate is
still ignored as a whole. Whichever style comes first in the configured order
wins, and a malformed part of a lower-priority one is ignored.

The compound extraction golden changes in exactly those cases (24 of 1274):
the lower-priority tracestate is carried, and a reparented span's last parent is
its p: rather than the Datadog parent id. Injected headers are unchanged in all
of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dougqh dougqh added comp: core Tracer core tag: performance Performance related changes tag: ai generated Largely based on code generated by an AI or LLM labels Nov 23, 2026
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 81.82%
• Overall Coverage: 59.87% (-0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 41c61a9 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.06 s 13.94 s [+0.1%; +1.7%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.93 s 12.96 s [-0.9%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 17.77 s 17.58 s [+0.3%; +1.9%] (maybe worse)
startup:petclinic:iast:Agent 17.55 s 17.70 s [-1.8%; +0.0%] (no difference)
startup:petclinic:profiling:Agent 17.35 s 17.09 s [+0.6%; +2.4%] (maybe worse)
startup:petclinic:sca:Agent 17.77 s 17.54 s [+0.4%; +2.2%] (maybe worse)
startup:petclinic:tracing:Agent 16.78 s 16.74 s [-0.9%; +1.4%] (no difference)

Commit: 41c61a99 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

This branch has not been deployed

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

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: performance Performance related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant