open-telemetry / open-telemetry/opentelemetry-ruby
Add a small http hook to OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter is hard to extend for small HTTP customizations.
For example, I want to sign outgoing requests, but currently I need to reimplement the whole send_bytes method.
It would be great to have a small hook that runs after the request is built and before it is sent, e.g.:
def customize_request(request)
request
end
Then custom exporters could do:
class SignedMetricsExporter < OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter
private
def customize_request(request)
request['Authorization'] = signer.sign(request)
request
end
end
Lmk if you'd be open to such a change then I'd try to create a PR for it. Feel free to close the issue otherwise :)
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 OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter and trace its send_bytes method to find where the request is built and sent. Add the requested customization hook at that boundary, preserving the request flow and allowing subclasses to modify it. Done means a custom exporter can add an Authorization header without reimplementing send_bytes, with focused coverage for the hook behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100