diff --git a/tests/ext/startup_logging.phpt b/tests/ext/startup_logging.phpt index d0eabcd699..d5eea598fd 100644 --- a/tests/ext/startup_logging.phpt +++ b/tests/ext/startup_logging.phpt @@ -53,4 +53,7 @@ enabled_from_env: true opcache.file_cache: null dynamic_instrumentation_enabled: false exception_replay_enabled: false +otlp_traces_export_enabled: false +otlp_metrics_export_enabled: false +otlp_logs_export_enabled: false loaded_by_ssi: false diff --git a/tests/ext/startup_logging_config.phpt b/tests/ext/startup_logging_config.phpt index 67126c07ee..aed90f0837 100644 --- a/tests/ext/startup_logging_config.phpt +++ b/tests/ext/startup_logging_config.phpt @@ -27,6 +27,8 @@ $env = [ 'DD_TRACE_REPORT_HOSTNAME' => '1', 'DD_TRACE_TRACED_INTERNAL_FUNCTIONS' => 'array_sum,mt_rand,DateTime::add', 'DD_TRACE_ENABLED' => '1', + 'DD_METRICS_OTEL_ENABLED' => '1', + 'DD_LOGS_OTEL_ENABLED' => '1', ]; $logs = dd_get_startup_logs($ini, $env); @@ -53,6 +55,9 @@ dd_dump_startup_logs($logs, [ 'report_hostname_on_root_span', 'traced_internal_functions', 'enabled_from_env', + 'otlp_traces_export_enabled', + 'otlp_metrics_export_enabled', + 'otlp_logs_export_enabled', ]); ?> --EXPECT-- @@ -76,3 +81,6 @@ measure_compile_time: false report_hostname_on_root_span: true traced_internal_functions: "array_sum,mt_rand,DateTime::add" enabled_from_env: true +otlp_traces_export_enabled: false +otlp_metrics_export_enabled: true +otlp_logs_export_enabled: true diff --git a/tests/ext/startup_logging_json.phpt b/tests/ext/startup_logging_json.phpt index 8b00c8de42..92c30bb4d0 100644 --- a/tests/ext/startup_logging_json.phpt +++ b/tests/ext/startup_logging_json.phpt @@ -54,5 +54,8 @@ enabled_from_env: true opcache.file_cache: null dynamic_instrumentation_enabled: false exception_replay_enabled: false +otlp_traces_export_enabled: false +otlp_metrics_export_enabled: false +otlp_logs_export_enabled: false loaded_by_ssi: false datadog.trace.sources_path_reachable: false diff --git a/tracer/tracer_startup_logging.c b/tracer/tracer_startup_logging.c index b64530d9ff..2e1e1a05f9 100644 --- a/tracer/tracer_startup_logging.c +++ b/tracer/tracer_startup_logging.c @@ -60,6 +60,13 @@ void ddtrace_populate_startup_config(HashTable *ht) { dd_add_assoc_bool(ht, ZEND_STRL("sidecar_trace_sender"), get_global_DD_TRACE_SIDECAR_TRACE_SENDER()); dd_add_assoc_bool(ht, ZEND_STRL("dynamic_instrumentation_enabled"), get_global_DD_DYNAMIC_INSTRUMENTATION_ENABLED()); dd_add_assoc_bool(ht, ZEND_STRL("exception_replay_enabled"), get_global_DD_EXCEPTION_REPLAY_ENABLED()); + + // OTLP telemetry export status (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 mirror DD_METRICS_OTEL_ENABLED / DD_LOGS_OTEL_ENABLED (request-scoped). + dd_add_assoc_bool(ht, ZEND_STRL("otlp_traces_export_enabled"), false); + dd_add_assoc_bool(ht, ZEND_STRL("otlp_metrics_export_enabled"), get_DD_METRICS_OTEL_ENABLED()); + dd_add_assoc_bool(ht, ZEND_STRL("otlp_logs_export_enabled"), get_DD_LOGS_OTEL_ENABLED()); } static bool dd_file_exists(const char *file) {