Commit 468d566
Add stable session ID headers to telemetry requests (#10914)
Add stable session ID headers to telemetry requests
Implements the Stable Service Instance Identifier RFC for Java.
- Add DD-Session-ID header (= runtime_id) to all telemetry requests
- Add DD-Root-Session-ID header when process is a child (inherited from parent)
- Read _DD_ROOT_JAVA_SESSION_ID from environment at init time
- Auto-propagate _DD_ROOT_JAVA_SESSION_ID to child processes via
ProcessBuilder instrumentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidate session ID propagation into existing ProcessImplStartAdvice
Remove separate ProcessBuilderSessionId instrumentation files and fold
env var injection into the existing ProcessImplStartAdvice. Adds
_DD_ROOT_JAVA_SESSION_ID to the child process environment map directly
in the ProcessImpl.start() hook.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add DD-Root-Session-ID assertion to telemetry header tests
Verify DD-Session-ID equals runtime ID and DD-Root-Session-ID is absent
when rootSessionId == runtimeId (non-child process), or present with
the correct value when they differ.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix config-inversion lint and advice bytecode issues
- Use ConfigHelper.env() instead of EnvironmentVariables.get() for
_DD_ROOT_JAVA_SESSION_ID to satisfy config-inversion-linter. The
underscore prefix bypasses supported-config validation (internal var).
- Remove readOnly=false from @Advice.Argument(1) — we mutate the map
via put(), not reassign the reference. readOnly=false generates
unnecessary bytecode that breaks bootstrap class instrumentation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR feedback: include rootSessionId in logs, respect runtimeIdEnabled, fix test
- Add rootSessionId to Config.toString() for tracer log visibility
- Gate getRootSessionId() behind runtimeIdEnabled like getRuntimeId()
- Force environment map initialization in test to fix test_inst failures
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unnecessary comment
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>1 parent aebdcee commit 468d566
File tree
5 files changed
+62
-2
lines changed- dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src
- main/java/datadog/trace/instrumentation/java/lang
- test/groovy/datadog/trace/instrumentation/java/lang
- internal-api/src/main/java/datadog/trace/api
- telemetry/src
- main/java/datadog/telemetry
- test/groovy/datadog/telemetry
5 files changed
+62
-2
lines changedLines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
334 | 349 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
795 | 801 | | |
796 | 802 | | |
797 | 803 | | |
| |||
3123 | 3129 | | |
3124 | 3130 | | |
3125 | 3131 | | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
3126 | 3136 | | |
3127 | 3137 | | |
3128 | 3138 | | |
| |||
5863 | 5873 | | |
5864 | 5874 | | |
5865 | 5875 | | |
| 5876 | + | |
| 5877 | + | |
| 5878 | + | |
5866 | 5879 | | |
5867 | 5880 | | |
5868 | 5881 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
| |||
0 commit comments