feat(otlp-grpc-exporter): add gRPC channelOptions as config parameter#6332
Open
vitorvasc wants to merge 5 commits intoopen-telemetry:mainfrom
Open
feat(otlp-grpc-exporter): add gRPC channelOptions as config parameter#6332vitorvasc wants to merge 5 commits intoopen-telemetry:mainfrom
vitorvasc wants to merge 5 commits intoopen-telemetry:mainfrom
Conversation
…nsport interfaces Signed-off-by: Vitor Vasconcellos <vitor.vasconcellos@mercadolivre.com>
…channelOptions Signed-off-by: Vitor Vasconcellos <vitor.vasconcellos@mercadolivre.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6332 +/- ##
==========================================
- Coverage 95.58% 95.55% -0.04%
==========================================
Files 314 315 +1
Lines 9590 9607 +17
Branches 2221 2228 +7
==========================================
+ Hits 9167 9180 +13
- Misses 423 427 +4
🚀 New features to boost your workflow:
|
Signed-off-by: Vitor Vasconcellos <vitor.vasconcellos@mercadolivre.com>
Signed-off-by: Vitor Vasconcellos <vitor.vasconcellos@mercadolivre.com>
vitorvasc
commented
Jan 23, 2026
Comment on lines
34
to
+36
| compression?: CompressionAlgorithm; | ||
| userAgent?: string; | ||
| channelOptions?: ChannelOptions; |
Member
Author
There was a problem hiding this comment.
With full ChannelOptions support, the compression and userAgent parameters could potentially be deprecated.
Here's how they could be passed instead:
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
import { compressionAlgorithms } from '@grpc/grpc-js';
const exporter = new OTLPTraceExporter({
url: 'otel-collector.example.com:4317',
- compression: 'gzip',
- userAgent: 'my-service/1.0.0',
+ channelOptions: {
+ 'grpc.primary_user_agent': 'my-service/1.0.0',
+ 'grpc.default_compression_algorithm': compressionAlgorithms.gzip,
+ 'grpc.keepalive_timeout_ms': 60000,
+ 'grpc.keepalive_permit_without_calls': 1,
+ 'grpc.initial_reconnect_backoff_ms': 5000,
+ 'grpc.max_reconnect_backoff_ms': 5000,
+ },
});Should we move forward and mark both those attributes as deprecated?
cjihrig
reviewed
Jan 23, 2026
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
|
@cjihrig @vitorvasc can we please get this merged? |
Contributor
|
@Dhruv-Garg79 this still requires review and approval from a project maintainer. |
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.
Which problem is this PR solving?
Currently, the
GrpcExporterTransportonly allows configuring compression and user-agent options. This change exposes the fullChannelOptionsinterface, enabling users to tune settings such as:grpc.keepalive_time_ms,grpc.keepalive_timeout_ms,grpc.keepalive_permit_without_callsgrpc.initial_reconnect_backoff_ms,grpc.max_reconnect_backoff_msgrpc.max_send_message_length,grpc.max_receive_message_length@grpc/grpc-jschannel optionsFixes #6231
Short description of the changes
Add
channelOptions?: ChannelOptionsparameter to theOTLPGRPCExporterConfigNodeinterface, passing it through the configuration workflow to the gRPC client constructor.Type of change
How Has This Been Tested?
Unit tests to ensure
channelOptionspasses through the configuration pipeline to the gRPC client constructor, with no changes to existing behavior:otlp-grpc-configuration.test.ts- config merging (user > fallback > default)grpc-exporter-transport.test.ts- transport accepts channelOptionsconvert-legacy-otlp-grpc-options.test.ts- legacy conversion passthroughChecklist: