Support configurable OTLP exporter protocol for traces and logs#6254
Open
shuheiktgw wants to merge 1 commit intomainfrom
Open
Support configurable OTLP exporter protocol for traces and logs#6254shuheiktgw wants to merge 1 commit intomainfrom
shuheiktgw wants to merge 1 commit intomainfrom
Conversation
9933587 to
0a1d6b3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
shuheiktgw
commented
Mar 31, 2026
| .with_tonic() | ||
| .build() | ||
| .context("failed to initialize OpenTelemetry OTLP exporter")?; | ||
| let global_protocol = env::var("OTEL_EXPORTER_OTLP_PROTOCOL").ok(); |
Collaborator
Author
There was a problem hiding this comment.
Note that these environment variables are not supported by the Rust SDK, so we need to handle them manually.
0a1d6b3 to
2e0ae4c
Compare
2e0ae4c to
cd77bf2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OTEL_EXPORTER_OTLP_PROTOCOLand per-signal env vars (OTEL_EXPORTER_OTLP_TRACES_PROTOCOL,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL) to select gRPC, HTTP/protobuf, or HTTP/JSON transport for the OTLP exporter. Default remains gRPC for backward compatibility.I'm new to Rust, so I'd really appreciate any feedback on my coding style 🙇
Test
Verified all 3 protocols deliver both traces and logs to a local OTEL Collector (v0.84.0).
Collector setup:
Save the following as
/tmp/otel-debug-config.yaml:Prerequisite:
1. gRPC (default)
2. HTTP/protobuf
3. HTTP/JSON
What to verify in Collector stdout:
TracesExporter+ResourceSpansoutput (traces received)LogsExporter+ResourceLog+LogRecordoutput (logs received)