Repository navigation
feat(tracing): report OTLP export status in startup log - #4056
Conversation
Add otlp_traces_export_enabled, otlp_metrics_export_enabled, and otlp_logs_export_enabled to the "DATADOG TRACER CONFIGURATION" startup diagnostic log, matching the shared cross-language schema. PHP exports traces natively via the Datadog Agent (never over OTLP), so otlp_traces_export_enabled is always false. The metrics and logs flags reflect the existing DD_METRICS_OTEL_ENABLED / DD_LOGS_OTEL_ENABLED configs -- the same request-scoped values the userland OpenTelemetry resolver consults -- so the log matches actual export behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Benchmarks [ tracer ]Benchmark execution time: 2026-07-24 20:03:51 Comparing candidate commit 74464cc in PR branch Found 2 performance improvements and 5 performance regressions! Performance is the same for 187 metrics, 0 unstable metrics.
|
### What does this PR do? Adds three boolean fields to the `DATADOG TRACER CONFIGURATION` startup log: - `otlp_traces_export_enabled` reports whether the tracer selected the OTLP trace writer. - `otlp_metrics_export_enabled` reports whether the tracer will start OTel runtime metrics. - `otlp_logs_export_enabled` reports whether OTel logs are enabled in the tracer configuration. Updates the startup-log expectations, clears the OTLP-related environment variables in `TestStartupLog`, and tests the metrics startup gate with and without the OTel metrics hook installed. ### Motivation Part of the cross-tracer work to use the same OTLP export-status fields in each tracer's startup diagnostics. The fields show which signals a service exports over OTLP. Related PRs: - dd-trace-js: DataDog/dd-trace-js#9517 - dd-trace-py: DataDog/dd-trace-py#19265 - dd-trace-java: DataDog/dd-trace-java#12062 - dd-trace-dotnet: DataDog/dd-trace-dotnet#8936 - dd-trace-rb: DataDog/dd-trace-rb#6096 - dd-trace-php: DataDog/dd-trace-php#4056 - system-tests: DataDog/system-tests#7376 - dd-trace-py OTLP logs fix: DataDog/dd-trace-py#19266 ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. (N/A: startup diagnostic-log fields only.) - [ ] There is a benchmark for any new code, or changes to existing code. (N/A: no hot-path or performance-sensitive code.) - [ ] If this interacts with the agent in a new way, a system test has been added. (N/A: no new agent interaction.) - [ ] New code is free of linting errors. You can check this by running `make lint` locally. (Full lint not run; `gofmt` and `git diff --check` are clean.) - [x] New code doesn't break existing tests. You can check this by running `make test` locally. (`go test ./ddtrace/tracer -count=1` passes.) - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [ ] All generated files are up to date. You can check this by running `make generate` locally. (N/A: no generated files changed.) - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. (N/A: no module changes.) Co-authored-by: dario.castane <dario.castane@datadoghq.com>
Description
Adds three boolean fields to the "DATADOG TRACER CONFIGURATION" startup log (
tracer/tracer_startup_logging.c):otlp_traces_export_enabled: constantfalse. PHP has no OTLP trace export onmaster;OTEL_TRACES_EXPORTER=otlpis treated as invalid, and traces always go to the Datadog Agent.otlp_metrics_export_enabled:get_DD_METRICS_OTEL_ENABLED().otlp_logs_export_enabled:get_DD_LOGS_OTEL_ENABLED().DD_METRICS_OTEL_ENABLEDandDD_LOGS_OTEL_ENABLEDwere already registered, so no new configuration registration was needed. The metrics and logs getters read the same request-scoped values the userland OpenTelemetry resolver (DatadogResolver) consults, so the log matches actual export behavior.The three
.phptstartup-logging tests were updated to cover the new fields, including a case that setsDD_METRICS_OTEL_ENABLED=1andDD_LOGS_OTEL_ENABLED=1and asserts the metrics/logs flags flip totrue.Part of a cross-tracer effort to report OTLP export status with identical JSON keys across dd-trace-*.
Note for reviewers: current
masteralready sits at the ZAI configuration ceiling (NUMBER_OF_CONFIGURATIONS == ZAI_CONFIG_ENTRIES_COUNT_MAX == 300), so a clean non-Windows build can trip the_Static_assertinext/configuration.cindependent of this change. This PR adds zero config entries, so it does not move that count, but CI may still surface the assert.Reviewer checklist
Related PRs — cross-tracer OTLP startup-log effort
CI note
The failing
PHP Language Testsare PHP-core's own stream tests (ext/standard/tests/streams/opendir-003.phpt/opendir-004.phpt,opendir()overftps://) failing on an expired upstream TLS certificate — unrelated to this change. The.phpttests added by this PR pass. The remainingtest_extension_ci/swoolereds are transient CI flakes.