Add stable session ID headers to telemetry requests#10914
Add stable session ID headers to telemetry requests#10914gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits intomasterfrom
Conversation
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>
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>
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>
- 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>
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
| */ | ||
| static class RuntimeIdHolder { | ||
| static final String runtimeId = RandomUtils.randomUUID().toString(); | ||
| static final String rootSessionId = initRootSessionId(); |
There was a problem hiding this comment.
❓ Is this a value that we should include in tracer logs? We already include runtimeId in the logs 🤔
There was a problem hiding this comment.
Any reason not to? backend will start correlating telemetry by root session id but maybe we can optionally include it in logs if they are runtime id does note equal root it
There was a problem hiding this comment.
For simplicity's sake, I'm in favor of just including the raw value in logs unless you have objections
(ref)
| } | ||
|
|
||
| public String getRootSessionId() { | ||
| return RuntimeIdHolder.rootSessionId; |
There was a problem hiding this comment.
What if runtimeIdEnabled is false? Currently, RuntimeID returns "" if runtimeIdEnabled is false - should rootSessionId follow the same trend? Otherwise we risk a situation where there is no runtimeId but there is a rootSessionId. (ref)
There was a problem hiding this comment.
we should disable it i believe
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 64 metrics, 6 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.061 s) : 0, 1060549
Total [baseline] (8.841 s) : 0, 8841236
Agent [candidate] (1.054 s) : 0, 1053809
Total [candidate] (8.813 s) : 0, 8813413
section iast
Agent [baseline] (1.224 s) : 0, 1223950
Total [baseline] (9.524 s) : 0, 9524076
Agent [candidate] (1.242 s) : 0, 1242383
Total [candidate] (9.578 s) : 0, 9577594
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.207 ms) : 0, 1207
crashtracking [candidate] (1.207 ms) : 0, 1207
BytebuddyAgent [baseline] (632.761 ms) : 0, 632761
BytebuddyAgent [candidate] (627.552 ms) : 0, 627552
AgentMeter [baseline] (29.573 ms) : 0, 29573
AgentMeter [candidate] (29.327 ms) : 0, 29327
GlobalTracer [baseline] (257.262 ms) : 0, 257262
GlobalTracer [candidate] (256.542 ms) : 0, 256542
AppSec [baseline] (31.823 ms) : 0, 31823
AppSec [candidate] (31.599 ms) : 0, 31599
Debugger [baseline] (59.743 ms) : 0, 59743
Debugger [candidate] (59.495 ms) : 0, 59495
Remote Config [baseline] (588.308 µs) : 0, 588
Remote Config [candidate] (583.755 µs) : 0, 584
Telemetry [baseline] (8.021 ms) : 0, 8021
Telemetry [candidate] (8.078 ms) : 0, 8078
Flare Poller [baseline] (3.503 ms) : 0, 3503
Flare Poller [candidate] (3.521 ms) : 0, 3521
section iast
crashtracking [baseline] (1.205 ms) : 0, 1205
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (794.399 ms) : 0, 794399
BytebuddyAgent [candidate] (807.79 ms) : 0, 807790
AgentMeter [baseline] (11.346 ms) : 0, 11346
AgentMeter [candidate] (11.727 ms) : 0, 11727
GlobalTracer [baseline] (246.615 ms) : 0, 246615
GlobalTracer [candidate] (249.387 ms) : 0, 249387
AppSec [baseline] (27.186 ms) : 0, 27186
AppSec [candidate] (26.9 ms) : 0, 26900
Debugger [baseline] (66.203 ms) : 0, 66203
Debugger [candidate] (70.37 ms) : 0, 70370
Remote Config [baseline] (525.171 µs) : 0, 525
Remote Config [candidate] (528.366 µs) : 0, 528
Telemetry [baseline] (11.265 ms) : 0, 11265
Telemetry [candidate] (9.137 ms) : 0, 9137
Flare Poller [baseline] (3.934 ms) : 0, 3934
Flare Poller [candidate] (3.332 ms) : 0, 3332
IAST [baseline] (25.309 ms) : 0, 25309
IAST [candidate] (25.691 ms) : 0, 25691
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1056547
Total [baseline] (11.002 s) : 0, 11002059
Agent [candidate] (1.059 s) : 0, 1059259
Total [candidate] (11.005 s) : 0, 11004831
section appsec
Agent [baseline] (1.247 s) : 0, 1247374
Total [baseline] (11.16 s) : 0, 11159855
Agent [candidate] (1.252 s) : 0, 1251808
Total [candidate] (11.205 s) : 0, 11205039
section iast
Agent [baseline] (1.234 s) : 0, 1233856
Total [baseline] (11.374 s) : 0, 11373720
Agent [candidate] (1.225 s) : 0, 1225450
Total [candidate] (11.377 s) : 0, 11376858
section profiling
Agent [baseline] (1.19 s) : 0, 1189926
Total [baseline] (11.022 s) : 0, 11022000
Agent [candidate] (1.19 s) : 0, 1190389
Total [candidate] (11.186 s) : 0, 11185893
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.204 ms) : 0, 1204
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (628.684 ms) : 0, 628684
BytebuddyAgent [candidate] (629.236 ms) : 0, 629236
AgentMeter [baseline] (29.348 ms) : 0, 29348
AgentMeter [candidate] (29.278 ms) : 0, 29278
GlobalTracer [baseline] (256.449 ms) : 0, 256449
GlobalTracer [candidate] (256.947 ms) : 0, 256947
AppSec [baseline] (31.66 ms) : 0, 31660
AppSec [candidate] (31.739 ms) : 0, 31739
Debugger [baseline] (60.363 ms) : 0, 60363
Debugger [candidate] (60.407 ms) : 0, 60407
Remote Config [baseline] (588.77 µs) : 0, 589
Remote Config [candidate] (581.839 µs) : 0, 582
Telemetry [baseline] (8.004 ms) : 0, 8004
Telemetry [candidate] (9.517 ms) : 0, 9517
Flare Poller [baseline] (4.264 ms) : 0, 4264
Flare Poller [candidate] (4.372 ms) : 0, 4372
section appsec
crashtracking [baseline] (1.214 ms) : 0, 1214
crashtracking [candidate] (1.187 ms) : 0, 1187
BytebuddyAgent [baseline] (658.976 ms) : 0, 658976
BytebuddyAgent [candidate] (661.473 ms) : 0, 661473
AgentMeter [baseline] (12.103 ms) : 0, 12103
AgentMeter [candidate] (12.142 ms) : 0, 12142
GlobalTracer [baseline] (258.171 ms) : 0, 258171
GlobalTracer [candidate] (259.193 ms) : 0, 259193
AppSec [baseline] (177.658 ms) : 0, 177658
AppSec [candidate] (177.989 ms) : 0, 177989
Debugger [baseline] (66.245 ms) : 0, 66245
Debugger [candidate] (66.5 ms) : 0, 66500
Remote Config [baseline] (629.589 µs) : 0, 630
Remote Config [candidate] (638.058 µs) : 0, 638
Telemetry [baseline] (8.333 ms) : 0, 8333
Telemetry [candidate] (8.428 ms) : 0, 8428
Flare Poller [baseline] (3.602 ms) : 0, 3602
Flare Poller [candidate] (3.664 ms) : 0, 3664
IAST [baseline] (24.249 ms) : 0, 24249
IAST [candidate] (24.333 ms) : 0, 24333
section iast
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (801.169 ms) : 0, 801169
BytebuddyAgent [candidate] (794.844 ms) : 0, 794844
AgentMeter [baseline] (11.443 ms) : 0, 11443
AgentMeter [candidate] (11.407 ms) : 0, 11407
GlobalTracer [baseline] (247.965 ms) : 0, 247965
GlobalTracer [candidate] (246.747 ms) : 0, 246747
AppSec [baseline] (26.632 ms) : 0, 26632
AppSec [candidate] (26.361 ms) : 0, 26361
Debugger [baseline] (70.717 ms) : 0, 70717
Debugger [candidate] (70.637 ms) : 0, 70637
Remote Config [baseline] (538.01 µs) : 0, 538
Remote Config [candidate] (532.082 µs) : 0, 532
Telemetry [baseline] (9.237 ms) : 0, 9237
Telemetry [candidate] (9.176 ms) : 0, 9176
Flare Poller [baseline] (3.343 ms) : 0, 3343
Flare Poller [candidate] (3.327 ms) : 0, 3327
IAST [baseline] (25.399 ms) : 0, 25399
IAST [candidate] (25.233 ms) : 0, 25233
section profiling
crashtracking [baseline] (1.174 ms) : 0, 1174
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (686.74 ms) : 0, 686740
BytebuddyAgent [candidate] (686.695 ms) : 0, 686695
AgentMeter [baseline] (9.019 ms) : 0, 9019
AgentMeter [candidate] (9.051 ms) : 0, 9051
GlobalTracer [baseline] (216.678 ms) : 0, 216678
GlobalTracer [candidate] (216.555 ms) : 0, 216555
AppSec [baseline] (32.398 ms) : 0, 32398
AppSec [candidate] (32.329 ms) : 0, 32329
Debugger [baseline] (66.338 ms) : 0, 66338
Debugger [candidate] (65.502 ms) : 0, 65502
Remote Config [baseline] (570.748 µs) : 0, 571
Remote Config [candidate] (575.657 µs) : 0, 576
Telemetry [baseline] (7.806 ms) : 0, 7806
Telemetry [candidate] (7.887 ms) : 0, 7887
Flare Poller [baseline] (3.521 ms) : 0, 3521
Flare Poller [candidate] (4.34 ms) : 0, 4340
ProfilingAgent [baseline] (94.449 ms) : 0, 94449
ProfilingAgent [candidate] (95.016 ms) : 0, 95016
Profiling [baseline] (95.022 ms) : 0, 95022
Profiling [candidate] (95.6 ms) : 0, 95600
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 19 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section baseline
no_agent (19.331 ms) : 19133, 19529
. : milestone, 19331,
appsec (18.5 ms) : 18317, 18683
. : milestone, 18500,
code_origins (18.115 ms) : 17932, 18299
. : milestone, 18115,
iast (17.934 ms) : 17758, 18111
. : milestone, 17934,
profiling (18.723 ms) : 18537, 18910
. : milestone, 18723,
tracing (17.672 ms) : 17499, 17846
. : milestone, 17672,
section candidate
no_agent (19.407 ms) : 19210, 19605
. : milestone, 19407,
appsec (18.732 ms) : 18541, 18923
. : milestone, 18732,
code_origins (17.891 ms) : 17712, 18070
. : milestone, 17891,
iast (17.884 ms) : 17711, 18058
. : milestone, 17884,
profiling (18.887 ms) : 18699, 19076
. : milestone, 18887,
tracing (17.573 ms) : 17399, 17748
. : milestone, 17573,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section baseline
no_agent (1.184 ms) : 1173, 1196
. : milestone, 1184,
iast (3.176 ms) : 3132, 3219
. : milestone, 3176,
iast_FULL (5.977 ms) : 5915, 6038
. : milestone, 5977,
iast_GLOBAL (3.482 ms) : 3424, 3540
. : milestone, 3482,
profiling (2.172 ms) : 2148, 2196
. : milestone, 2172,
tracing (1.862 ms) : 1844, 1880
. : milestone, 1862,
section candidate
no_agent (1.176 ms) : 1164, 1187
. : milestone, 1176,
iast (3.334 ms) : 3288, 3379
. : milestone, 3334,
iast_FULL (5.997 ms) : 5937, 6058
. : milestone, 5997,
iast_GLOBAL (3.569 ms) : 3507, 3632
. : milestone, 3569,
profiling (2.107 ms) : 2089, 2125
. : milestone, 2107,
tracing (1.847 ms) : 1830, 1865
. : milestone, 1847,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section baseline
no_agent (15.558 s) : 15558000, 15558000
. : milestone, 15558000,
appsec (14.602 s) : 14602000, 14602000
. : milestone, 14602000,
iast (18.385 s) : 18385000, 18385000
. : milestone, 18385000,
iast_GLOBAL (18.161 s) : 18161000, 18161000
. : milestone, 18161000,
profiling (15.52 s) : 15520000, 15520000
. : milestone, 15520000,
tracing (14.915 s) : 14915000, 14915000
. : milestone, 14915000,
section candidate
no_agent (15.524 s) : 15524000, 15524000
. : milestone, 15524000,
appsec (14.729 s) : 14729000, 14729000
. : milestone, 14729000,
iast (18.12 s) : 18120000, 18120000
. : milestone, 18120000,
iast_GLOBAL (17.875 s) : 17875000, 17875000
. : milestone, 17875000,
profiling (14.874 s) : 14874000, 14874000
. : milestone, 14874000,
tracing (14.94 s) : 14940000, 14940000
. : milestone, 14940000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~1f53945a22, baseline=1.61.0-SNAPSHOT~828c9cc58f
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1462, 1485
. : milestone, 1474,
appsec (3.723 ms) : 3504, 3941
. : milestone, 3723,
iast (2.255 ms) : 2186, 2324
. : milestone, 2255,
iast_GLOBAL (2.3 ms) : 2231, 2370
. : milestone, 2300,
profiling (2.096 ms) : 2041, 2151
. : milestone, 2096,
tracing (2.08 ms) : 2027, 2134
. : milestone, 2080,
section candidate
no_agent (1.475 ms) : 1464, 1487
. : milestone, 1475,
appsec (3.8 ms) : 3578, 4022
. : milestone, 3800,
iast (2.266 ms) : 2197, 2335
. : milestone, 2266,
iast_GLOBAL (2.303 ms) : 2234, 2373
. : milestone, 2303,
profiling (2.08 ms) : 2025, 2134
. : milestone, 2080,
tracing (2.067 ms) : 2014, 2120
. : milestone, 2067,
|
…Enabled, 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>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
Summary
Implements the Stable Service Instance Identifier RFC for Java telemetry.
DD-Session-IDheader (=runtime_id) to all telemetry HTTP requestsDD-Root-Session-IDheader when process was spawned by an instrumented parent (value inherited via_DD_ROOT_JAVA_SESSION_IDenv var)_DD_ROOT_JAVA_SESSION_IDto child processes via the existingProcessImpl.start()hook — no user code changes required_DD_ROOT_JAVA_SESSION_IDis an internal env var (underscore-prefixed to bypass config-inversion validation, not added to supported configurations)This enables the backend to correlate telemetry across parent/child process relationships without the broken uncorrelated
runtime_idregeneration on process spawn.Files changed
Config.javarootSessionIdtoRuntimeIdHolder, read viaConfigHelper.env()from_DD_ROOT_JAVA_SESSION_ID(falls back toruntimeId)TelemetryRequest.javaDD-Session-IDand conditionalDD-Root-Session-IDheaders inhttpRequest()ProcessImplStartAdvice.java_DD_ROOT_JAVA_SESSION_IDinto child process environment map via existingProcessImpl.start()hookTestTelemetryRouter.groovyDD-Session-IDequals runtime ID andDD-Root-Session-IDis absent in non-child contextProcessImplInstrumentationSpecification.groovyCross-SDK references