From d3887bf6cc180118be9fc8a031cc3aefbfbeb668 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 25 Aug 2024 13:25:32 +0200 Subject: [bugfix] Let prometheus client do its own compression handling (#3232) --- internal/api/metrics/metrics.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'internal/api/metrics/metrics.go') diff --git a/internal/api/metrics/metrics.go b/internal/api/metrics/metrics.go index d89e56ad5..af774d5e8 100644 --- a/internal/api/metrics/metrics.go +++ b/internal/api/metrics/metrics.go @@ -30,9 +30,13 @@ type Module struct { } func New() *Module { - // Use our own gzip handler. + // Let prometheus use "identity", ie., no compression, + // or "gzip", to match our own gzip compression middleware. opts := promhttp.HandlerOpts{ - DisableCompression: true, + OfferedCompressions: []promhttp.Compression{ + promhttp.Identity, + promhttp.Gzip, + }, } // Instrument handler itself. -- cgit v1.2.3