[OTLP] Add support for GZip compression#7055
Open
martincostello wants to merge 8 commits intoopen-telemetry:mainfrom
Open
[OTLP] Add support for GZip compression#7055martincostello wants to merge 8 commits intoopen-telemetry:mainfrom
martincostello wants to merge 8 commits intoopen-telemetry:mainfrom
Conversation
martincostello
commented
Apr 10, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7055 +/- ##
==========================================
+ Coverage 89.09% 89.16% +0.07%
==========================================
Files 271 271
Lines 13065 13120 +55
==========================================
+ Hits 11640 11699 +59
+ Misses 1425 1421 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds configurable gzip compression support to the OTLP exporter to align with the OTLP exporter specification (including env var configuration) and validates behavior via new/updated unit tests.
Changes:
- Introduces
OtlpExportCompressionandOtlpExporterOptions.Compression, with spec env var support (OTEL_EXPORTER_OTLP*_COMPRESSION). - Implements gzip request compression for OTLP over HTTP and gRPC export clients.
- Adds/updates unit tests and updates changelog + public API tracking files.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpSpecConfigDefinitionTests.cs | Extends spec config test data and assertions to include compression env vars. |
| test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpHttpExportClientTests.cs | Adds HTTP export tests validating payload and headers with/without gzip. |
| test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpGrpcExportClientTests.cs | Adds gRPC export tests validating compressed framing and decompression behavior. |
| test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpExporterOptionsTests.cs | Extends options/config tests to cover compression env var parsing and invalid values. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs | Adds Compression option, parsing helper, and spec-env-var application. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExportCompression.cs | New public enum defining supported compression modes. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/IOtlpExporterOptions.cs | Adds Compression to internal options contract. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OtlpSpecConfigDefinitions.cs | Adds spec env var constants for compression across signals. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ExportClient/OtlpHttpExportClient.cs | Implements gzip compression for HTTP request content. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ExportClient/OtlpGrpcExportClient.cs | Implements gzip compression for gRPC framing + request header. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ExportClient/OtlpExportClient.cs | Centralizes content creation via overridable method; wires CompressionEnabled. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md | Documents new opt-in gzip compression configuration. |
| src/OpenTelemetry.Exporter.OpenTelemetryProtocol/.publicApi/Stable/PublicAPI.Unshipped.txt | Tracks new public API surface (OtlpExportCompression, OtlpExporterOptions.Compression). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4 tasks
Add support for GZip compression to the OTLP exporter. Picks up from open-telemetry#6494. Resolves open-telemetry#3961. Co-Authored-By: Hannah Haering <157852144+hannahhaering@users.noreply.github.com>
- Avoid allocating a buffer for every write of compressed gRPC data. - Simplify `IsTransientNetworkError()`.
Add coverage for different ways to specify the compression value.
- Ensure only one `grpc-encoding` header. - Remove redundant null checks.
martincostello
commented
Apr 21, 2026
Remove trailing spaces.
Add missing blank line.
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.
Fixes #3961
Changes
Add support for GZip compression to the OTLP exporter.
Continues the work started in #6494.
Once released, should also update the compliance matrix.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes