Skip to content

Conversation

@milas
Copy link
Contributor

@milas milas commented Nov 19, 2025

Motivation

Add support for http/protobuf in addition to gRPC for OpenTelemetry OTLP metrics export.

This is the default OpenTelemetry SDKs use nowadays, and there is a defined OTEL_..._PROTOCOL env 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_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL environment variables.

If unset or explicitly set to grpc, use gRPC exporter.
If has http/ prefix (e.g. http/protobuf or http/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.

@milas milas marked this pull request as ready for review November 20, 2025 15:21
@Joibel Joibel self-assigned this Nov 21, 2025
@Joibel Joibel requested a review from Copilot November 21, 2025 10:46
Copy link
Member

@Joibel Joibel left a 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.

@Joibel Joibel added cherry-pick/3.6 Cherry-pick this to release-3.6 cherry-pick/3.7 Cherry-pick this to release-3.7 labels Nov 21, 2025
@Joibel Joibel merged commit 3e30918 into argoproj:main Nov 21, 2025
47 checks passed
Copy link
Contributor

Copilot AI left a 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 otlpmetrichttp dependency 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`.
Copy link

Copilot AI Nov 21, 2025

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.

Suggested change
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`.

Copilot uses AI. Check for mistakes.
@argo-cd-cherry-pick-bot
Copy link

❌ Cherry-pick failed for 3.7. Please check the workflow logs for details.

@argo-cd-cherry-pick-bot
Copy link

❌ Cherry-pick failed for 3.6. Please check the workflow logs for details.

Joibel added a commit to Joibel/argo-workflows that referenced this pull request Nov 24, 2025
@Joibel Joibel removed the cherry-pick/3.6 Cherry-pick this to release-3.6 label Nov 24, 2025
Joibel added a commit to Joibel/argo-workflows that referenced this pull request Nov 24, 2025
Joibel added a commit to Joibel/argo-workflows that referenced this pull request Nov 24, 2025
Joibel added a commit that referenced this pull request Nov 26, 2025
Joibel pushed a commit that referenced this pull request Nov 26, 2025
Signed-off-by: Milas Bowman <[email protected]>
(cherry picked from commit 3e30918)
Signed-off-by: Alan Clucas <[email protected]>
Joibel added a commit that referenced this pull request Nov 26, 2025
Joibel added a commit that referenced this pull request Nov 26, 2025
guanguxiansheng pushed a commit to guanguxiansheng/argo-workflows that referenced this pull request Dec 15, 2025
guanguxiansheng pushed a commit to guanguxiansheng/argo-workflows that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/telemetry/metrics cherry-pick/3.7 Cherry-pick this to release-3.7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants