feat(otel): add support for opentelemetry logs#3748
feat(otel): add support for opentelemetry logs#3748rachelyangdog wants to merge 4 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3748 +/- ##
==========================================
- Coverage 68.85% 68.78% -0.08%
==========================================
Files 166 166
Lines 19015 19015
Branches 1792 1792
==========================================
- Hits 13093 13079 -14
- Misses 5111 5124 +13
- Partials 811 812 +1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
✨ Fix all issues with BitsAI or with Cursor
|
Benchmarks [ tracer ]Benchmark execution time: 2026-05-07 20:37:08 Comparing candidate commit d0b32bc in PR branch Found 3 performance improvements and 2 performance regressions! Performance is the same for 187 metrics, 2 unstable metrics. scenario:EmptyFileBench/benchEmptyFileBaseline
scenario:MessagePackSerializationBench/benchMessagePackSerialization
scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache
scenario:PDOBench/benchPDOOverheadWithDBM
scenario:PHPRedisBench/benchRedisOverhead-opcache
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0b32bc04a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ($name === 'OTEL_PHP_AUTOLOAD_ENABLED') { | ||
| return \dd_trace_env_config('DD_METRICS_OTEL_ENABLED') | ||
| || \dd_trace_env_config('DD_LOGS_OTEL_ENABLED'); |
There was a problem hiding this comment.
Prevent logs mode from enabling all OTel signals
When only DD_LOGS_OTEL_ENABLED=true is set, this makes OTEL_PHP_AUTOLOAD_ENABLED resolve to true, and the OpenTelemetry PHP autoloader initializes tracer, meter, and logger providers together. Because this resolver does not also force OTEL_TRACES_EXPORTER and OTEL_METRICS_EXPORTER to none, their SDK defaults remain otlp, so enabling Datadog's OTel logs mode can also start exporting traces and metrics for applications that did not opt into those signals.
Useful? React with 👍 / 👎.
Description
Adds OpenTelemetry logs support to dd-trace-php, gated behind a new DD_LOGS_OTEL_ENABLED configuration flag.
New config flag:
DD_LOGS_OTEL_ENABLED(default: false) enables OTel log collection and OTLP export. When enabled, Datadog's own log injection is suppressed so the two pipelines don't conflict.Reviewer checklist