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.
|
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.