open-telemetry / open-telemetry/opentelemetry-ruby
Follow HTTP redirects in the OTLP Metrics exporter
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
Spec requirement
HTTP redirects SHOULD be followed rather than retried against the original URI (protocol/exporter.md:194-209, general OTLP/HTTP connection-handling expectation).
Current behavior
metrics_exporter.rb:146-149 (permalink) detects Net::HTTPRedirection and calls handle_redirect(response['location']), but handle_redirect (util.rb:126 (permalink)) is a no-op. The subsequent redo re-sends the request to the same original URI, not the Location from the redirect response.
Suggested fix
Implement handle_redirect to re-parse location into a new request URI (and a new HTTP connection if the host/port changed) before the redo. Make sure this behavior is consistent across all signal exporters.
Related rows in SPEC_COMPLIANCE_METRICS.md
OTLP-10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with exporter/otlp-metrics/lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb at the redirect handling branch, then read util.rb around handle_redirect. Compare redirect handling across the signal exporters. Done means the Location target is used for the retried request, with a new connection when its host or port changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100