Repository navigation
Conversation
A decision with no tracestate, otel member or sampling rate is just a priority and a decision maker, and almost every extracted priority and manual or forced keep is one of a few dozen such pairs. States are immutable, so those decisions now use preallocated shared states instead of building one per trace. Datadog-only extraction no longer builds a sampling state at all, and compound extraction builds one instead of two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only extraction replaces a trace's tracestate, before the trace is shared, so it needn't be published together with the sampling decision. The tracestate now lives only on the propagation tags, and the codec reads it from there. A sampling state changes with the tracestate only when its ot member does, so a tracestate without one keeps the trace's shared state: compound and W3C extraction of such a tracestate build no sampling state at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ember Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An extracted trace with an ot tracestate member still built a sampling state per trace to hold the member unparsed. The merge already builds a W3CTracestate holding it, so the trace now keeps that as its tracestate and it parses the member on first read. The inherited state records only the decision and its pending checks, so it's shared like the others: extraction with an ot member no longer builds a sampling state. The member is now read through the propagation tags, which resolve an inherited state against the member they hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: 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
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.
What Does This Do
Extracting a trace no longer builds a per-trace sampling state, whatever the headers. Three steps, one commit each (plus tests):
otmember and no sampling rate is just a priority and a decision maker. Extracted priorities, manual keeps and forced keeps are almost always one of a few dozen such pairs.otmember changes.otmember lives on the trace.W3CTracestateholding the member unparsed. The trace now keeps that as its tracestate, and it parses the member on first read.InheritedSamplingStatebecomes a shared marker that records only the decision and its pending checks.otmember is now read throughPropagationTags.getOtelTraceState(SamplingState). A marker state throws if read directly, so a missed caller fails loudly instead of reading nothing.Sampling states built per extraction (instrumented count):
otot)Motivation
TraceSegment work (APMLP-2049), phase 3: per-trace sampling state at extraction.
Allocation (
PropagationScenariosBenchmark, JDK 17,-t 4, default sampler,-prof gc, B/op). These are 1-fork spot checks taken after each step; the same jar varies by about ±16 B from run to run.otmember on the traceThat's −96 and −120 B per extracted request. The withOtelMember arms move the same way but have ±20–90 B error.
No new per-trace cost:
PTagsstays at 88 B, because the tracestate field holds either the header value or theW3CTracestate. Shared inherited states are filled on first use. The cache of whether theotmember keeps its position, which W3C injection checks on every inject, moves to theW3CTracestatefor inherited members.Additional Notes
CompoundExtractionGoldenTestpasses; full corpus: 0 of 10150 cases differ.CoreSpanBuilderTest: 2992 pass.TracerConnectionReliabilityTestand the order-dependentPendingTraceBufferTestflare dump.PTagsFactory. This stack predates it, so a rebase onto master will conflict there.🤖 Generated with Claude Code