Repository navigation
Introduce TagStore for eager tag post-processors (dense store - part 3) #13001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gh-worker-dd-mergequeue-cf854d
merged 28 commits into
master
from
dougqh/eager-postprocessors-span-context
Oct 29, 2026
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
eabce40
Bucket known tags by slot in TagMap
dougqh 19b2e88
Add whole-span and whole-trace allocation benchmarks
dougqh 6e65a31
Vary TraceShapeBenchmark's trace size; test bucketHash
dougqh d72b784
Merge branch 'master' into dougqh/tagmap-slot-buckets
dougqh 2271e4f
Add a whole-request benchmark for the header code paths
dougqh fa9b441
Make a null tag value remove the tag in TagMap
dougqh 7894411
Merge branch 'dougqh/tagmap-null-removes' into dougqh/tagmap-slot-buc…
dougqh 8e57e87
Introduce SpanStorage for eager tag post-processors
dougqh 3c91e7f
Attach HeaderPathBenchmark's server span through the local tracer
dougqh ae4ec9a
Merge branch 'dougqh/tagmap-slot-buckets' into dougqh/eager-postproce…
dougqh f1b60e4
Remove an earlier payload tag when a later value at its path is null
dougqh 54ed705
Merge branch 'dougqh/tagmap-null-removes' into dougqh/tagmap-slot-buc…
dougqh e0b022c
Merge branch 'dougqh/tagmap-slot-buckets' into dougqh/eager-postproce…
dougqh 884c508
Load and store known tags by id through SpanStorage
dougqh 590f6e7
Test that a known tag's id and name address the same tag in SpanStorage
dougqh 38dc4b3
Rename SpanStorage to TagStore
dougqh 4540183
Apply suggestion from @sarahchen6
dougqh 7739065
Say why the span implements TagStore
dougqh 08b0645
Merge branch 'dougqh/tagmap-null-removes' into dougqh/tagmap-slot-buc…
dougqh f5fa140
Merge branch 'dougqh/tagmap-slot-buckets' into dougqh/eager-postproce…
dougqh a0f2786
Merge branch 'master' into dougqh/tagmap-null-removes
dougqh 0c73aff
Merge branch 'dougqh/tagmap-null-removes' into dougqh/tagmap-slot-buc…
dougqh 933a688
Merge branch 'dougqh/tagmap-slot-buckets' into dougqh/eager-postproce…
dougqh 36bbbd2
Test that urlOrPath answers the same from a TagStore as from a map
dougqh b9dbfa9
Name the post-processor chain's TagStore parameter unsafeTags
dougqh 3eed220
Rename TagStoreTest's storage helper and locals
dougqh 710f8e9
Merge branch 'master' into dougqh/eager-postprocessors-span-context
dougqh cdfc195
Annotate TagStore's nullable values and keep implementation details o…
dougqh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/EagerPostProcessorChain.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package datadog.trace.core.tagprocessor; | ||
|
|
||
| import datadog.trace.api.TagStore; | ||
| import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; | ||
| import datadog.trace.core.DDSpanContext; | ||
| import java.util.Objects; | ||
| import javax.annotation.Nonnull; | ||
|
|
||
| /** Runs eager post-processors in order. */ | ||
| public final class EagerPostProcessorChain extends EagerTagsPostProcessor { | ||
| private final EagerTagsPostProcessor[] chain; | ||
|
|
||
| public EagerPostProcessorChain(@Nonnull final EagerTagsPostProcessor... processors) { | ||
| chain = Objects.requireNonNull(processors); | ||
| } | ||
|
|
||
| @Override | ||
| public void processTags( | ||
| TagStore unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { | ||
| for (final EagerTagsPostProcessor processor : chain) { | ||
| processor.processTags(unsafeTags, spanContext, spanLinks); | ||
| } | ||
| } | ||
| } | ||
23 changes: 23 additions & 0 deletions
23
dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/EagerTagsPostProcessor.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package datadog.trace.core.tagprocessor; | ||
|
|
||
| import datadog.trace.api.TagStore; | ||
| import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; | ||
| import datadog.trace.core.DDSpanContext; | ||
|
|
||
| /** | ||
| * A tag post-processor run on the application thread as a span finishes. It works on the span's | ||
| * tags as stored, through a {@link TagStore}, rather than a {@code TagMap} the span would have to | ||
| * build for it. The span passes itself as that store, which allocates nothing. | ||
| */ | ||
| public abstract class EagerTagsPostProcessor { | ||
| /** | ||
| * Processes the span's tags. | ||
| * | ||
| * @param unsafeTags the span's tags as stored, to read and write; the caller holds the span's tag | ||
| * lock | ||
| * @param spanContext the span, for its other properties | ||
| * @param spanLinks the span's links | ||
| */ | ||
| public abstract void processTags( | ||
|
dougqh marked this conversation as resolved.
|
||
| TagStore unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks); | ||
| } | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.