Skip to content

feat: report OTLP export status in startup log#19265

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

feat: report OTLP export status in startup log#19265
bm1549 wants to merge 1 commit into
mainfrom
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 tracer's startup diagnostic log ("DATADOG TRACER CONFIGURATION"), emitted from collect() in ddtrace/internal/debug.py:

  • otlp_traces_export_enabled: reflects agent_config.trace_otlp_export_enabled (OTLP trace export, opt-in via OTEL_TRACES_EXPORTER=otlp)
  • otlp_metrics_export_enabled: reflects config._otel_metrics_enabled
  • otlp_logs_export_enabled: reflects config._otel_logs_enabled

This makes the OTLP export configuration visible in the startup log, which helps with support and debugging. It is part of a cross-tracer effort, so the JSON keys are identical across the dd-trace-* libraries.

Testing

  • test_standard_tags asserts the three keys are present and boolean.
  • test_otlp_export_enabled_fields_default runs in a subprocess with the OTLP-related env cleared and asserts all three default to False.
  • test_otlp_export_enabled_fields_set runs in a subprocess with OTEL_TRACES_EXPORTER=otlp and the metrics/logs flags enabled, and asserts all three report True.

Risks

None. The change only adds fields to an existing diagnostic log. No existing fields or behavior change.

Additional Notes

No release note is needed: this change only adds fields to the tracer's internal startup diagnostic log and does not change customer-facing behavior. The PR carries the changelog/no-changelog label.


Related PRs — cross-tracer OTLP startup-log effort

@datadog-datadog-prod-us1-2

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

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 10 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741491-d2b8243-musllinux_1_2_x86_64, 1]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1]   View in Datadog   GitLab

View all 10 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Jul 24, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-24 21:58:29

Comparing candidate commit 0025fca in PR branch brian.marks/otlp-export-startup-log with baseline commit e083509 in branch main.

Found 0 performance improvements and 5 performance regressions! Performance is the same for 612 metrics, 10 unstable metrics.

scenario:iastaspects-lstrip_aspect

  • 🟥 execution_time [+52.545µs; +59.053µs] or [+16.275%; +18.290%]

scenario:iastaspects-translate_aspect

  • 🟥 execution_time [+43.695µs; +51.719µs] or [+8.727%; +10.330%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+85.648µs; +93.001µs] or [+20.155%; +21.886%]

scenario:span-start

  • 🟥 execution_time [+1.353ms; +1.511ms] or [+8.636%; +9.641%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+210.895ns; +248.018ns] or [+9.944%; +11.695%]

Add three boolean fields to the tracer's startup diagnostic log
("DATADOG TRACER CONFIGURATION") indicating whether each telemetry
signal is exported over OTLP:

- otlp_traces_export_enabled: reflects agent_config.trace_otlp_export_enabled
  (opt-in via OTEL_TRACES_EXPORTER=otlp; export is routed through
  libdatadog's native OTLP trace exporter)
- otlp_metrics_export_enabled: reflects config._otel_metrics_enabled
- otlp_logs_export_enabled: reflects config._otel_logs_enabled

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bm1549 bm1549 added the changelog/no-changelog A changelog entry is not required for this PR. label Jul 24, 2026
@bm1549
bm1549 force-pushed the brian.marks/otlp-export-startup-log branch from e09dd49 to 0025fca Compare July 24, 2026 21:30
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/debug.py                                               @DataDog/apm-core-python
tests/integration/test_debug.py                                         @DataDog/apm-core-python

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

🚨 New circular imports detected 🚨

15 new circular import(s) have been introduced by this PR:

Show new cycles (showing 5 of 15 shortest)
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.botocore -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kombu -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.google_cloud_pubsub -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.kafka -> ddtrace.internal.datastreams
ddtrace.internal.datastreams -> ddtrace.internal.datastreams.aiokafka -> ddtrace.internal.datastreams

To see all cycles, download the cycles-base.json and cycles-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/cycles.py compare cycles-base.json cycles-pr.json

Please consider refactoring your changes in accordance to the Separation of Concerns principle.

⚠️ Existing circular imports

There are 18 circular imports that already exist on the base branch and have not been changed by this PR.

Show existing cycles (showing 5 of 18 shortest)
ddtrace._trace.span -> ddtrace.internal.core -> ddtrace._trace.span
ddtrace.trace -> ddtrace._trace.tracer -> ddtrace.internal.debug -> ddtrace.trace
ddtrace -> ddtrace.trace -> ddtrace._trace.tracer -> ddtrace.internal.debug -> ddtrace
ddtrace -> ddtrace.trace -> ddtrace._trace.tracer -> ddtrace.internal.debug -> ddtrace.internal.runtime.runtime_metrics -> ddtrace
ddtrace._trace.span -> ddtrace._trace.context -> ddtrace.internal.utils.http -> ddtrace.internal.utils -> ddtrace.internal.core -> ddtrace._trace.span

To see all cycles, download the cycles-base.json and cycles-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/cycles.py compare cycles-base.json cycles-pr.json

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 changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant