Skip to content

fix: give each OTLP signal its own path - #4

Merged
crypto-a merged 1 commit into
mainfrom
6/otlp-signal-paths
Aug 18, 2026
Merged

crypto-a merged 1 commit into
mainfrom
6/otlp-signal-paths

Conversation

@crypto-a

Copy link
Copy Markdown
Contributor

kit v0.5.1.

The bug

0.5.0 handed one endpoint to both OTLPSpanExporter and OTLPMetricExporter. Passing endpoint= overrides the SDK and is used verbatim — only when the SDK reads OTEL_EXPORTER_OTLP_ENDPOINT itself does it append /v1/traces or /v1/metrics.

So a service configured with http://collector:4318 posted both signals to the collector's root:

POST http://10.118.48.8:4318            →  404   ← what it actually sent
POST http://10.118.48.8:4318/v1/metrics →  200
POST http://10.118.48.8:4318/v1/traces  →  200

The service served perfectly. The only evidence was Failed to export span batch code: 404 in its own logs. That is why it reached a running cluster before anyone noticed — a monitoring pipeline that silently carries nothing looks identical to one nobody has sent data to yet.

Particularly ironic given _tracing.py says everything except the endpoint is read by the SDK from its standard variables. The endpoint was the one thing it overrode, and it overrode it wrongly.

The fix

signal_endpoint() appends the signal path unless the caller already supplied one. Both forms are accepted because both exist in the wild: a base URL from someone who read the OTel docs, and a full signal URL from someone who read this kit's own tests.

How it was found

By deploying the template to DOKS, pointing it at a real Collector on the monitoring VM, and observing that no metric or trace ever arrived. No unit test would have caught it: it needs a real collector answering 404 on the wrong path.

205 tests, 100% coverage, ruff and pyright clean.

0.5.0 handed one endpoint to both OTLPSpanExporter and
OTLPMetricExporter. Passing endpoint= overrides the SDK and is used
VERBATIM; only when the SDK reads OTEL_EXPORTER_OTLP_ENDPOINT itself
does it append /v1/traces or /v1/metrics.

So a service configured with http://collector:4318 POSTed both signals
to the collector's root and got 404 for every batch. The service served
perfectly and the only evidence was an export error in its own logs,
which is why this reached a running cluster before anyone noticed.

Found by deploying the template to DOKS, pointing it at a real
Collector, and observing that no metric or trace ever arrived.

Both endpoint forms are accepted now, because both exist: a base URL
from an operator who read the OTel docs, and a full signal URL from one
who read this kit's own tests.
@crypto-a
crypto-a merged commit 156148b into main Aug 18, 2026
4 checks passed
@crypto-a
crypto-a deleted the 6/otlp-signal-paths branch August 18, 2026 22:52
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.

1 participant