Skip to content

Commit fc93457

Browse files
author
elsa
committed
fix: init storage before telemetry init
The telemetry initialization now takes a few seconds. This delay is problematic for trace-to-profile correlation since it delays the initialization of the process storage, which the eBPF profiler checks once when it first encounters the process. * src/datadog/tracer.cpp
1 parent a07db89 commit fc93457

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/datadog/tracer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ Tracer::Tracer(const FinalizedTracerConfig& config,
7171
baggage_injection_enabled_(false),
7272
baggage_extraction_enabled_(false),
7373
correlate_full_host_profiles_(config.correlate_full_host_profiles) {
74+
#ifdef __linux__
75+
// TODO: change the way this is done to handle programs that fork.
76+
if (correlate_full_host_profiles_)
77+
elastic_apm_profiling_correlation_process_storage_v1 =
78+
*signature_.generate_process_correlation_storage();
79+
#endif
80+
7481
telemetry::init(config.telemetry, logger_, config.http_client,
7582
config.event_scheduler, config.agent_url);
7683
if (config.report_hostname) {
@@ -104,13 +111,6 @@ Tracer::Tracer(const FinalizedTracerConfig& config,
104111
}
105112
}
106113

107-
#ifdef __linux__
108-
// TODO: change the way this is done to handle programs that fork.
109-
if (correlate_full_host_profiles_)
110-
elastic_apm_profiling_correlation_process_storage_v1 =
111-
*signature_.generate_process_correlation_storage();
112-
#endif
113-
114114
if (config.log_on_startup) {
115115
logger_->log_startup([configuration = this->config()](std::ostream& log) {
116116
log << "DATADOG TRACER CONFIGURATION - " << configuration;

0 commit comments

Comments
 (0)