open-telemetry / open-telemetry/opentelemetry-ruby

Follow HTTP redirects in the OTLP Metrics exporter

Open
#2,371 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug metrics spec-compliance spec:stable
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.