Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/ext/startup_logging.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions tests/ext/startup_logging_config.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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--
Expand All @@ -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
3 changes: 3 additions & 0 deletions tests/ext/startup_logging_json.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions tracer/tracer_startup_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading