[bugfix] Let prometheus client do its own compression handling (#3232)

This commit is contained in:
tobi
2024-08-25 13:25:32 +02:00
committed by GitHub
parent bef0dfc66c
commit d3887bf6cc
3 changed files with 14 additions and 5 deletions

View File

@ -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.