Skip to content

Add WithCompression option to OTLP gRPC exporter #6756

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

huiyifyj
Copy link

@huiyifyj huiyifyj commented May 8, 2025

Add a new WithCompression option to set the compression type for the OTLP gRPC exporter.
Add Compression type that wraps otlpconfig.Compression and define NoCompression and GzipCompression constants to specify compression options.

Make the compression option function of the OTLP gRPC exporter consistent with the OTLP HTTP exporter.

refer to https://github.com/open-telemetry/opentelemetry-go/blob/v1.35.0/exporters/otlp/otlptrace/otlptracehttp/options.go#L105

Add a new `WithCompression` option to set the compression type for the OTLP gRPC exporter.
Add `Compression` type that wraps `otlpconfig.Compression` and define `NoCompression` and `GzipCompression` constants to specify compression options.
Make the compression option function of the OTLP gRPC exporter consistent with the OTLP HTTP exporter.

refer to https://github.com/open-telemetry/opentelemetry-go/blob/v1.35.0/exporters/otlp/otlptrace/otlptracehttp/options.go#L105
Copy link

linux-foundation-easycla bot commented May 8, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huiyifyj
Copy link
Author

Can you use https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc#WithCompressor instead?

WithCompression and WithCompressor options have same effect indeed.
It's better to use WithCompression which has the same function signature as the HTTP exporter otlptracehttp.WithCompression options.

@pellared
Copy link
Member

pellared commented May 12, 2025

Sorry, but I do not understand why it would be better. Adding a new option that does already the same would confuse the users as they would not know which one it is better to use (and why). Moreover, we would be increasing the API surface that would need to be maintained.

Besides, are you aware that the added WithCompression is not working (using the option does not have any effect)?

@MrAlias
Copy link
Contributor

MrAlias commented May 20, 2025

@huiyifyj can you please provide justification for your previous assertion.

@MrAlias MrAlias added the response needed Waiting on user input before progress can be made label May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
response needed Waiting on user input before progress can be made
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants