feat(otel): add otel logs support#5446
Conversation
|
Thank you for updating Change log entry section 👏 Visited at: 2026-05-13 15:13:37 UTC |
Typing analysisNote: Ignored files are excluded from the next sections.
|
163ee55 to
ab5c738
Compare
|
✨ Fix all issues with BitsAI or with Cursor
|
BenchmarksBenchmark execution time: 2026-05-14 22:32:32 Comparing candidate commit 30fc0c6 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 45 metrics, 1 unstable metrics.
|
6d04056 to
c8199ac
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e29c67f104
ℹ️ 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".
68e13d6 to
1c319d8
Compare
vpellan
left a comment
There was a problem hiding this comment.
Approving so that it's not blocked
What does this PR do?
Adds OpenTelemetry logs support to
dd-trace-rb, mirroring the existing metrics signal integration. When enabled, the library configures anOpenTelemetry::SDK::Logs::LoggerProviderbacked by an OTLP exporter (http/protobuf) and wires it into the global OTel SDK. Datadog'slog_injectionis automatically disabled to prevent duplicate trace-correlation fields in log output.Also extracts a shared
SignalConfigurationmodule (included by bothLogsandMetrics) to eliminate verbatim duplication of the OTel resource-building and config-fallback logic.Motivation:
Customers using OpenTelemetry in Ruby applications can already export traces and metrics through Datadog's OTel-compatible pipeline; this PR closes the remaining gap for logs.
Change log entry
Yes. Added OpenTelemetry logs support. When
DD_LOGS_OTEL_ENABLED=true, the library configures an OTLP log exporter that sends log records to the Datadog Agent (or any OTLP endpoint) and automatically disables Datadog log injection to avoid duplicate trace-correlation fields.Configuration
The following environment variables are newly supported:
DD_LOGS_OTEL_ENABLEDfalsetrueto activate OTel logsOTEL_LOGS_EXPORTERotlpnoneto disable the exporter without disabling the SDKOTEL_EXPORTER_OTLP_LOGS_ENDPOINThttp://<agent>:4318/v1/logsOTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_LOGS_HEADERSOTEL_EXPORTER_OTLP_HEADERSOTEL_EXPORTER_OTLP_LOGS_TIMEOUT10000msOTEL_EXPORTER_OTLP_TIMEOUTOTEL_BLRP_MAX_QUEUE_SIZE2048OTEL_BLRP_SCHEDULE_DELAY1000msOTEL_BLRP_EXPORT_TIMEOUT30000msOTEL_BLRP_MAX_EXPORT_BATCH_SIZE512Requires Ruby >= 3.1 and the
opentelemetry-logs-sdk+opentelemetry-exporter-otlp-logsgems.Additional Notes:
The
SignalConfigurationmodule refactor is a pure internal change with no public API impact — bothLogsandMetricsinclude it and the extracted methods were previously private.How to test the change?
bundle exec rake test:opentelemetryIntegration: enable
DD_LOGS_OTEL_ENABLED=truewith a running Datadog Agent (OTLP receiver on port 4318) and emit log records via the OTel Ruby SDK — records appear in Datadog Log Management with trace correlation.