metrics: DisableCompression on promhttp.HandlerOpts + pin in tests#43
Merged
Conversation
7 tasks
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
F1 from the post-hardening audit (2026-05-10).
PR #34 moved `/metrics` out of the chi Compress middleware group, which the audit verified by code inspection. But the live droplet still returns `Content-Encoding: gzip` when scrapers send `Accept-Encoding: gzip` — because `promhttp.HandlerFor` runs its OWN gzip layer with `DisableCompression` defaulting to `false`. PR #34's regression test passed because it used a stub handler, not the real `metrics.Handler()`.
Production is currently saved by alloy's `enable_compression = false` workaround (PR #32). This PR removes the dependency on that workaround.
Changes
A regression in either layer now fails loud.
After this lands
Once deployed, the alloy workaround in #32 becomes redundant. Filing a follow-up issue to drop `enable_compression = false` from the alloy template + the live droplet config — but only after this binary is verified live.
Test plan