Skip to content

fix(tracing): report OTLP endpoint on export failure - #19470

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
codex/fix-otlp-export-error-endpoint
Aug 5, 2026
Merged

fix(tracing): report OTLP endpoint on export failure#19470
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
codex/fix-otlp-export-error-endpoint

Conversation

@mabdinur

@mabdinur mabdinur commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

When native OTLP trace export fails, NativeWriter currently reports its configured Datadog Agent intake URL even though libdatadog attempted the OTLP endpoint. This makes an OTLP protocol or connectivity error look like an Agent fallback.

Use the configured OTLP trace endpoint in failure diagnostics whenever OTLP trace export is active. Agent export diagnostics keep their existing behavior.

The original investigation also exposed a separate protocol mismatch: released versions send OTLP traces over HTTP/JSON, while the repro targeted the collector's gRPC port. HTTP/protobuf and gRPC support are already tracked by #18609, DataDog/libdatadog#2171, and DataDog/libdatadog#2273; this PR does not duplicate those transport changes.

Testing

  • scripts/run-tests --venv 1ef5a52 -- -- tests/tracer/test_writer.py -k 'native_writer_reports_otlp_intake_endpoint or native_writer_stores_otlp_endpoint' (Python 3.13; 2 passed)
  • scripts/lint checks
  • scripts/lint style -- ddtrace/internal/writer/writer.py tests/tracer/test_writer.py
  • scripts/lint spelling -- releasenotes/notes/fix-otlp-export-error-endpoint-6e7b7c8f756ef3a7.yaml
  • riot run reno lint

Risks

Low. The change only affects the endpoint displayed in trace-export failure diagnostics when an OTLP endpoint is configured. It does not change routing, serialization, or retry behavior.

Additional Notes

The OTLP/DDOT reference and the original handoff document were corrected separately to record that the old port-4317 reproduction was testing an HTTP exporter against a gRPC receiver.

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

ddtrace/internal/writer/writer.py                                       @DataDog/apm-core-python
releasenotes/notes/fix-otlp-export-error-endpoint-6e7b7c8f756ef3a7.yaml  @DataDog/apm-python
tests/tracer/test_writer.py                                             @DataDog/apm-sdk-capabilities-python @DataDog/apm-core-python

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

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

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

@mabdinur
mabdinur marked this pull request as ready for review August 3, 2026 18:42
@mabdinur
mabdinur requested review from a team as code owners August 3, 2026 18:42
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Aug 3, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@pr-commenter

pr-commenter Bot commented Aug 3, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-03 18:57:15

Comparing candidate commit 79a9826 in PR branch codex/fix-otlp-export-error-endpoint with baseline commit 4399c31 in branch main.

Found 0 performance improvements and 3 performance regressions! Performance is the same for 354 metrics, 9 unstable metrics.

scenario:span-start

  • 🟥 execution_time [+1.300ms; +1.461ms] or [+8.174%; +9.183%]

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

  • 🟥 execution_time [+158.177ns; +193.697ns] or [+7.445%; +9.117%]

scenario:tracer-small

  • 🟥 execution_time [+30.746µs; +32.316µs] or [+9.516%; +10.001%]

@emmettbutler emmettbutler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix!

@mabdinur

mabdinur commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 5, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-05 15:45:16 UTC ℹ️ Start processing command /merge


2026-08-05 15:45:21 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 57m (p90).


2026-08-05 16:33:53 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit d064f8d into main Aug 5, 2026
1206 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the codex/fix-otlp-export-error-endpoint branch August 5, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants