From 6c8ef248f32dd3a7f95d918d14b753ade6ca4ab4 Mon Sep 17 00:00:00 2001 From: Ayan Khan Date: Tue, 14 Apr 2026 09:25:23 -0400 Subject: [PATCH] fix: use parentheses for signature_ init to match existing style Co-Authored-By: Claude Opus 4.6 (1M context) --- include/datadog/tracer_config.h | 10 +++++----- src/datadog/tracer.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/datadog/tracer_config.h b/include/datadog/tracer_config.h index 170c4980..4f9196db 100644 --- a/include/datadog/tracer_config.h +++ b/include/datadog/tracer_config.h @@ -141,6 +141,11 @@ struct TracerConfig { // specify the same `runtime_id` for all tracer instances in the same run. Optional runtime_id; + // Root session ID for stable telemetry correlation across forked workers. + // Integrations (nginx, httpd, kong) should set this in the master process + // before workers fork so all Tracers share the same root. + Optional root_session_id; + // `integration_name` is the name of the product integrating this library. // Example: "nginx", "envoy" or "istio". Optional integration_name; @@ -189,11 +194,6 @@ struct TracerConfig { // This option is ignored if `resource_renaming_enabled` is not `true`. Optional resource_renaming_always_simplified_endpoint; - // Root session ID for stable telemetry correlation across forked workers. - // Integrations (nginx, httpd, kong) should set this in the master process - // before workers fork so all Tracers share the same root. - Optional root_session_id; - /// A mapping of process-specific tags used to uniquely identify processes. /// /// The `process_tags` map allows associating arbitrary string-based keys and diff --git a/src/datadog/tracer.cpp b/src/datadog/tracer.cpp index aae9037b..43dede3d 100644 --- a/src/datadog/tracer.cpp +++ b/src/datadog/tracer.cpp @@ -49,10 +49,10 @@ Tracer::Tracer(const FinalizedTracerConfig& config, : logger_(config.logger), runtime_id_(config.runtime_id ? *config.runtime_id : RuntimeID::generate()), - signature_{runtime_id_, + signature_(runtime_id_, root_session_id::get_or_init( config.root_session_id.value_or(runtime_id_.string())), - config.defaults.service, config.defaults.environment}, + config.defaults.service, config.defaults.environment), config_manager_(std::make_shared(config)), collector_(/* see constructor body */), span_sampler_(