You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With telemetry on and an OTLP endpoint set, ocr always starts a metric exporter next to the trace exporter. A backend that only accepts traces answers /v1/metrics with 404, so every run ends with:
[ocr] WARNING: telemetry shutdown error: telemetry shutdown: [failed to upload metrics: failed to send metrics to http://collector:4318/v1/metrics: 404 Not Found (body: (empty))]
There is currently no way to export spans only.
Proposed Solution
Honour the standard OTEL_METRICS_EXPORTER variable. With none, ocr skips the metric exporter for OTLP gRPC, OTLP HTTP and the console exporter, and spans are exported as before. Any other value keeps today's behaviour.
Init would then set the global meter provider only when one was created. Passing a nil *sdkmetric.MeterProvider to otel.SetMeterProvider replaces the no-op provider and panics on the first Record* call; I checked that with a test.
Alternatives Considered
Sending metrics to another collector doesn't help when the only backend is trace-only. Ignoring the warning works, but it sits at the end of the stderr of every run, including failed ones.
Affected Area
Telemetry / Observability
Additional Context
I used Claude Code (Claude Opus 5.5) to trace the cause, draft the change and this text, and reviewed the result myself. I have a PR ready and will link it here.
Activity