Skip to content

feat(tracing): report OTLP export status in startup log#4056

Draft
bm1549 wants to merge 1 commit into
masterfrom
brian.marks/otlp-export-startup-log
Draft

feat(tracing): report OTLP export status in startup log#4056
bm1549 wants to merge 1 commit into
masterfrom
brian.marks/otlp-export-startup-log

Conversation

@bm1549

@bm1549 bm1549 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Adds three boolean fields to the "DATADOG TRACER CONFIGURATION" startup log (tracer/tracer_startup_logging.c):

  • otlp_traces_export_enabled: constant false. PHP has no OTLP trace export on master; OTEL_TRACES_EXPORTER=otlp is 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_ENABLED and DD_LOGS_OTEL_ENABLED were 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 .phpt startup-logging tests were updated to cover the new fields, including a case that sets DD_METRICS_OTEL_ENABLED=1 and DD_LOGS_OTEL_ENABLED=1 and asserts the metrics/logs flags flip to true.

Part of a cross-tracer effort to report OTLP export status with identical JSON keys across dd-trace-*.

Note for reviewers: current master already 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_assert in ext/configuration.c independent 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

  • Test coverage seems ok.
  • Appropriate labels assigned.

Related PRs — cross-tracer OTLP startup-log effort

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>
@bm1549 bm1549 added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jul 24, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 24, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 243 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | Extension Tea Tests: [7.0, debug-zts]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | Extension Tea Tests: [7.0, debug]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | Extension Tea Tests: [7.0, nts]   View in Datadog   GitLab

View all 243 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9256a24 | Docs | Datadog PR Page | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant