Skip to content

Commit a8f7f11

Browse files
mruegbwplotka
andauthored
Update prometheus/promhttp/http.go
Co-authored-by: Bartlomiej Plotka <[email protected]> Signed-off-by: Manuel Rüger <[email protected]>
1 parent 03af4da commit a8f7f11

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

prometheus/promhttp/http.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,17 @@ type HandlerOpts struct {
373373
// no effect on the HTTP status code because ErrorHandling is set to
374374
// ContinueOnError.
375375
Registry prometheus.Registerer
376-
// If DisableCompression is true, the handler will never compress the
377-
// response, even if requested by the client.
376+
// DisableCompression disables the response encoding (compression) and
377+
// encoding negotiation. If true, the handler will
378+
// never compress the response, even if requested
379+
// by the client and the OfferedCompressions field is ignored.
378380
DisableCompression bool
379-
// If DisableCompression is false, this option will allow to define the
380-
// set of offered encoding algorithms.
381-
EncodingOffers []string
381+
// OfferedCompressions is a set of encodings (compressions) handler will
382+
// try to offer when negotiating with the client. This defaults to zstd, gzip, identity
383+
//
384+
// NOTE: If handler can't agree on the encodings with the client or caller using unsupported or empty encodings in OfferedCompressions, handler always fallbacks to
385+
// no compression (identity), for compatibility reasons. In such cases ErrorLog will be used if set.
386+
OfferedCompressions []encoding
382387
// The number of concurrent HTTP requests is limited to
383388
// MaxRequestsInFlight. Additional requests are responded to with 503
384389
// Service Unavailable and a suitable message in the body. If

0 commit comments

Comments
 (0)