-
Notifications
You must be signed in to change notification settings - Fork 3.4k
chore(otel): add support for http/protobuf OTLP metrics export #15061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
67d83cc to
129b551
Compare
Signed-off-by: Milas Bowman <[email protected]>
129b551 to
610e235
Compare
Joibel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. I was aware it needed doing but hadn't gotten round to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for HTTP/protobuf OTLP metrics export in addition to the existing gRPC support. The implementation checks environment variables (OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL) to determine which protocol to use, defaulting to gRPC for backwards compatibility.
Key Changes:
- Added protocol detection logic to support both gRPC and HTTP exporters based on environment variables
- Added the
otlpmetrichttpdependency to enable HTTP-based OTLP export - Updated documentation to explain the default gRPC behavior and how to opt into HTTP
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| util/telemetry/metrics.go | Added protocol selection logic to choose between gRPC and HTTP OTLP exporters based on environment variables |
| go.mod | Added dependency for go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0 |
| go.sum | Added checksums for the new HTTP exporter dependency |
| docs/metrics.md | Documented that gRPC is the default and explained how to switch to HTTP using environment variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| You can configure the protocol using the environment variables documented in [standard environment variables](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/). | ||
|
|
||
| By default, GRPC is used; to switch to HTTP, set either the `OTEL_EXPORTER_OTLP_PROTOCOL` or `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` environment variable to `http/protobuf`. |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"GRPC" should be styled as "gRPC" (lowercase g, uppercase RPC) to match the standard capitalization used throughout the codebase and industry standard.
| By default, GRPC is used; to switch to HTTP, set either the `OTEL_EXPORTER_OTLP_PROTOCOL` or `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` environment variable to `http/protobuf`. | |
| By default, gRPC is used; to switch to HTTP, set either the `OTEL_EXPORTER_OTLP_PROTOCOL` or `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` environment variable to `http/protobuf`. |
|
❌ Cherry-pick failed for 3.7. Please check the workflow logs for details. |
|
❌ Cherry-pick failed for 3.6. Please check the workflow logs for details. |
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Milas Bowman <[email protected]> (cherry picked from commit 3e30918) Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
…roj#15061) Signed-off-by: Milas Bowman <[email protected]>
…15067) Signed-off-by: Alan Clucas <[email protected]>
Motivation
Add support for
http/protobufin addition to gRPC for OpenTelemetry OTLP metrics export.This is the default OpenTelemetry SDKs use nowadays, and there is a defined
OTEL_..._PROTOCOLenv var pattern as well. (gRPC is preserved as a default in Argo Workflows Controller for backwards compatibility.)Modifications
During telemetry initialization, look for the
OTEL_EXPORTER_OTLP_METRICS_PROTOCOLorOTEL_EXPORTER_OTLP_PROTOCOLenvironment variables.If unset or explicitly set to
grpc, use gRPC exporter.If has
http/prefix (e.g.http/protobuforhttp/json), use HTTP exporter.NOTE: This is technically different than the "modern" OTel SDK default, which prefers
http/protobuf, but that'd be a breaking change from the Argo Workflows perspective, so HTTP can be opted-in to by setting the variable.Verification
Local regression tests + familiarity with OpenTelemetry SDK behaviors.
Documentation
Added note about gRPC being default to
docs/metrics.md+ explanation for how to use HTTP.