Implement stable session identifier headers for telemetry#295
Implement stable session identifier headers for telemetry#295khanayan123 wants to merge 6 commits intomainfrom
Conversation
BenchmarksBenchmark execution time: 2026-03-26 19:14:04 Comparing candidate commit f124ca3 in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics.
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: f124ca3 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
a3b7684 to
0e65a27
Compare
Adds DD-Session-ID and DD-Root-Session-ID HTTP headers to all telemetry requests per the Stable Service Instance Identifier RFC. - DD-Session-ID is always set to the tracer's runtime_id - DD-Root-Session-ID is only set when it differs from the session ID (i.e. when running as a child process) - Root session ID is propagated to exec'd children via _DD_ROOT_CPP_SESSION_ID env var, read in finalize_config() - _DD_ROOT_CPP_SESSION_ID registered in the environment variable registry and supported-configurations.json Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
85d241a to
e40dd5d
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The central registry has this config as implementation B with an empty string default. Update environment.h to use "" and teach config-inversion to emit "B" for this var via an override map. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53d0524 to
1f8a254
Compare
Registry entry had trailing space in name (now fixed by registry team). Use implementation A and null default to match registry. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Implements the Stable Service Instance Identifier RFC for the C++ SDK.
DD-Session-ID(=runtime_id) and conditionalDD-Root-Session-IDheaders to all telemetry requests (app-started, heartbeats, app-closing, etc.)DD-Root-Session-IDis only sent when it differs fromDD-Session-ID(i.e., in child processes)_DD_ROOT_CPP_SESSION_IDvia the config registry (environment::lookup) or defaults to the currentruntime_idenvironment::set(_DD_ROOT_CPP_SESSION_ID, ...)is called at tracer init so exec'd children inherit it automatically (no-op if already set)Integration testing note
System-tests for
cpp_nginxandcpp_httpdcannot validate session headers until the downstream modules (nginx-datadog, httpd-datadog) release a version that includes these dd-trace-cpp changes. The system-tests manifest entries remainmissing_featureuntil then. Unit tests in this PR should validate the implementation directly.Companion system-tests PR: DataDog/system-tests#6510