Skip to content

Conversation

@allnightlong
Copy link
Contributor

@allnightlong allnightlong commented Dec 19, 2025

Resolves #7009

@allnightlong allnightlong marked this pull request as ready for review December 19, 2025 12:59
@shakuzen shakuzen changed the title #7009 Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender Dec 22, 2025
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Looks good overall. Thanks for the quick and thorough pull request. I left some feedback.

@shakuzen
Copy link
Member

Hi @allnightlong, I wanted to follow-up to see if you have time and interest to update this pull request based on the review I left. Let us know. We'd like to get this feature into the upcoming minor release.

@allnightlong
Copy link
Contributor Author

@shakuzen thanks for follow up
I've updated the PR, as you suggested

@allnightlong allnightlong force-pushed the otlp-compression-mode branch from d33d473 to 0a03711 Compare January 19, 2026 12:32
@allnightlong allnightlong changed the title Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender WIP: Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender Jan 19, 2026
@allnightlong allnightlong force-pushed the otlp-compression-mode branch 3 times, most recently from 6d9a501 to 4ac8ad2 Compare January 19, 2026 12:55
Add compressionMode parameter to OtlpMetricsSender.Request to support configurable compression in metrics requests.

Signed-off-by: Tigran Kavanosyan <[email protected]>
Wire compression mode configuration through to the HTTP metrics sender to enable configurable compression.

Signed-off-by: Tigran Kavanosyan <[email protected]>
Add test coverage for compression mode resolution from configuration and environment variables.

Signed-off-by: Tigran Kavanosyan <[email protected]>
Refactor compression mode configuration logic into a dedicated compressionModeFromConfig() method for better code organization.

Signed-off-by: Tigran Kavanosyan <[email protected]>
Signed-off-by: Tigran Kavanosyan <[email protected]>
Change enum values from ON/OFF to GZIP/NONE to align with OpenTelemetry specification naming conventions.

Signed-off-by: Tigran Kavanosyan <[email protected]>
Add fallback to the generic OTEL_EXPORTER_OTLP_COMPRESSION environment variable when the metrics-specific variable is not set.

Signed-off-by: Tigran Kavanosyan <[email protected]>
Signed-off-by: Tigran Kavanosyan <[email protected]>
Fix compression mode tests to use valid enum values (GZIP, NONE)
instead of invalid values (ON, OFF). Add test coverage for
OTEL_EXPORTER_OTLP_COMPRESSION fallback environment variable and
precedence between generic and metrics-specific compression env vars.

Signed-off-by: Tigran Kavanosyan <[email protected]>
@allnightlong allnightlong force-pushed the otlp-compression-mode branch 2 times, most recently from ad3776d to 9d4ec09 Compare January 19, 2026 13:13
@allnightlong allnightlong changed the title WIP: Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender Jan 19, 2026
@allnightlong allnightlong requested a review from shakuzen January 19, 2026 13:22
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the updates. It is looking great. Could we also add an integration test to ensure this actually works with an OTLP endpoint? I think a test case could probably be added to OTelCollectorIntegrationTest with gzip compression enabled in the config. Other than that, updating the documentation would also be good, but if you're not up for that we can take care of it separately.

Adds a test case to OTelCollectorIntegrationTest that verifies metrics export successfully when CompressionMode.GZIP is enabled.

Signed-off-by: Tigran Kavanosyan <[email protected]>
@allnightlong allnightlong force-pushed the otlp-compression-mode branch from 54fecbd to aa4ee50 Compare January 20, 2026 12:26
@allnightlong allnightlong requested a review from shakuzen January 20, 2026 12:34
@allnightlong
Copy link
Contributor Author

@shakuzen I've added the integration test - please check it out

Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the quick updates. I'll work on merging it tomorrow with some documentation updates.

@shakuzen shakuzen merged commit 436f24a into micrometer-metrics:main Jan 21, 2026
11 checks passed
@allnightlong allnightlong deleted the otlp-compression-mode branch January 21, 2026 09:48
jonatan-ivanov added a commit that referenced this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support compressing metrics payload in OtlpConfig and OtlpHttpMetricsSender

2 participants