feat(tracer): report OTLP export status in startup log#5062
Conversation
Add three boolean fields to the "DATADOG TRACER CONFIGURATION" startup log indicating whether each telemetry signal is exported over OTLP: - otlp_traces_export_enabled (tracer's cached otlpExportMode, which reflects that CI-Visibility and log-to-stdout writers are selected ahead of the OTLP writer) - otlp_metrics_export_enabled (OTel metrics signal enabled AND the OTLP metrics exporter selected: RuntimeMetricsOtelEnabled() && OTLPExportMetricsMode(); defaults to false, matching the other tracers) - otlp_logs_export_enabled (config LogsOTelEnabled) Update the startup-log golden assertions and clear the OTLP-driving env vars in the test so the expected output is deterministic regardless of shell/CI env pollution. Add a positive case asserting the metrics field is true when the OTel metrics signal and OTLP exporter are both active. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Config Audit |
|
BenchmarksBenchmark execution time: 2026-07-24 02:18:42 Comparing candidate commit ab2d137 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 326 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.
|
What does this PR do?
Adds three boolean fields to the "DATADOG TRACER CONFIGURATION" startup log (
startupInfoinddtrace/tracer/log.go) that report whether each telemetry signal is exported over OTLP:otlp_traces_export_enabled: the tracer's cachedotlpExportMode(true whenOTEL_TRACES_EXPORTER=otlpselects the OTLP trace writer, after CI Visibility and log-to-stdout writers have been ruled out)otlp_metrics_export_enabled:RuntimeMetricsOtelEnabled() && OTLPExportMetricsMode()otlp_logs_export_enabled:LogsOTelEnabled()It also updates the
log_test.gogolden assertions for the new fields and clears the OTLP-driving env vars inTestStartupLogso the expected output is deterministic regardless of shell/CI env pollution. A new subtest assertsotlp_metrics_export_enabledis true when both the OTel metrics signal and the OTLP metrics exporter are active.Motivation
Part of a cross-tracer effort to report OTLP export status in the startup diagnostic log using identical JSON keys across the dd-trace-* libraries. These flags make it easy to confirm which signals a service exports over OTLP when diagnosing configuration.
Reviewer's Checklist
make lintlocally. (gofmtclean on both files.)make testlocally. (TestStartupLogand all subtests pass.)make generatelocally. (N/A: no generated files touched.)🤖 Generated with Claude Code
Related PRs — cross-tracer OTLP startup-log effort