Repository navigation
Commit 960f771
Add trace.builder.tags.precedence.enabled to let explicit builder tags win (phase 1a) (#11738)
Add trace.builder.tags.precedence.enabled to let explicit builder tags win
Today the span builder applies tag contributors in this last-wins order:
mergedTracerTags, tagLedger (builder tags), coreTags (inbound header tags),
rootSpanTags, contextualTags. So inbound header / root-span / contextual tags
silently OVERRIDE explicit per-span tags set via the builder -- a wart flagged
in-code by Björn since 2020 ("maybe the builder tags should come last").
This adds an off-by-default flag that applies the ledger LAST so explicit
builder tags take precedence (the logical order), gated for gradual rollout.
The flag is a constant-folded `static final` (mirroring SPAN_BUILDER_REUSE_ENABLED)
so the JIT dead-code-eliminates the unused ordering branch on the hot span-build
path -- the flag is process-constant.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge branch 'master' into dougqh/builder-tags-precedence
Register builder-tags-precedence flag and fix static-config bug
- Add DD_TRACE_BUILDER_TAGS_PRECEDENCE_ENABLED to supported-configurations.json
so it's recognized as documented config instead of tripping
config-inversion/STRICT_TEST validation.
- Convert BUILDER_TAGS_PRECEDENCE from a static final (sourced from the global
Config.get() singleton at class-load) to a final instance field read from
the constructor's config param, so a CoreTracer built via
CoreTracerBuilder#withProperties/#config actually honors its own
configuration for this flag.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merge branch 'master' into dougqh/builder-tags-precedence
Merge remote-tracking branch 'origin/master' into HEAD
# Conflicts:
# dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java
# metadata/supported-configurations.json
Merge branch 'master' into dougqh/builder-tags-precedence
Address review feedback: trim historical comment, add flag-enabled tests
Moves the tag-ordering wart's historical context out of the in-code
comment (kept in the PR description instead) and adds test coverage
for trace.builder.tags.precedence.enabled=true and for per-tracer
(not global-default) flag resolution, per review discussion.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/dougqh/builder-tags-precedence' into dougqh/builder-tags-precedence
# Conflicts:
# dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java
Merge remote-tracking branch 'origin/master' into dougqh/builder-tags-precedence
Merge remote-tracking branch 'origin/master' into dougqh/builder-tags-precedence
# Conflicts:
# dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java
Merge branch 'master' into dougqh/builder-tags-precedence
Trigger CI: re-validate supported-configurations.json against Feature Parity Dashboard
DD_TRACE_BUILDER_TAGS_PRECEDENCE_ENABLED was just registered in the
Feature Parity Dashboard; re-running validate_supported_configurations_v2_local_file
to pick up the now-consistent registry entry.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merge branch 'master' into dougqh/builder-tags-precedence
Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>1 parent 19d19cf commit 960f771
5 files changed
Lines changed: 201 additions & 9 deletions
File tree
- dd-trace-api/src/main/java/datadog/trace/api/config
- dd-trace-core/src
- main/java/datadog/trace/core
- test/java/datadog/trace/core
- internal-api/src/main/java/datadog/trace/api
- metadata
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
Lines changed: 26 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
| |||
848 | 853 | | |
849 | 854 | | |
850 | 855 | | |
| 856 | + | |
| 857 | + | |
851 | 858 | | |
852 | 859 | | |
853 | 860 | | |
| |||
2327 | 2334 | | |
2328 | 2335 | | |
2329 | 2336 | | |
2330 | | - | |
2331 | | - | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
2332 | 2342 | | |
2333 | 2343 | | |
2334 | 2344 | | |
| |||
2344 | 2354 | | |
2345 | 2355 | | |
2346 | 2356 | | |
2347 | | - | |
2348 | | - | |
2349 | | - | |
2350 | | - | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
2351 | 2368 | | |
2352 | 2369 | | |
2353 | 2370 | | |
2354 | | - | |
2355 | | - | |
2356 | | - | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
2357 | 2374 | | |
2358 | 2375 | | |
2359 | 2376 | | |
| |||
Lines changed: 149 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
| 698 | + | |
698 | 699 | | |
699 | 700 | | |
700 | 701 | | |
| |||
922 | 923 | | |
923 | 924 | | |
924 | 925 | | |
| 926 | + | |
925 | 927 | | |
926 | 928 | | |
927 | 929 | | |
| |||
1571 | 1573 | | |
1572 | 1574 | | |
1573 | 1575 | | |
| 1576 | + | |
| 1577 | + | |
1574 | 1578 | | |
1575 | 1579 | | |
1576 | 1580 | | |
| |||
3655 | 3659 | | |
3656 | 3660 | | |
3657 | 3661 | | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
3658 | 3666 | | |
3659 | 3667 | | |
3660 | 3668 | | |
| |||
7048 | 7056 | | |
7049 | 7057 | | |
7050 | 7058 | | |
| 7059 | + | |
| 7060 | + | |
7051 | 7061 | | |
7052 | 7062 | | |
7053 | 7063 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5148 | 5148 | | |
5149 | 5149 | | |
5150 | 5150 | | |
| 5151 | + | |
| 5152 | + | |
| 5153 | + | |
| 5154 | + | |
| 5155 | + | |
| 5156 | + | |
| 5157 | + | |
| 5158 | + | |
5151 | 5159 | | |
5152 | 5160 | | |
5153 | 5161 | | |
| |||
0 commit comments