You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prometheus/promhttp/http.go
+10-5
Original file line number
Diff line number
Diff line change
@@ -373,12 +373,17 @@ type HandlerOpts struct {
373
373
// no effect on the HTTP status code because ErrorHandling is set to
374
374
// ContinueOnError.
375
375
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.
378
380
DisableCompressionbool
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
382
387
// The number of concurrent HTTP requests is limited to
383
388
// MaxRequestsInFlight. Additional requests are responded to with 503
384
389
// Service Unavailable and a suitable message in the body. If
0 commit comments