mirror of https://github.com/prometheus/prometheus
scrape: Fix accept header (#11542)
First of all, there was a typo: `encoding=delimited` was a left-over in the `scrapeAcceptHeader`. Second, the recently updated `version=1.0.0` prevents current versions of client_golang to negotiate OpenMetrics, as they expect `version=0.0.1` or no version at all. This commit adds, with lower priority, the latter (no version at all) to the accept header. Fixes #11540, Signed-off-by: beorn7 <beorn@grafana.com>pull/11543/head
parent
033b3efb12
commit
54ce07e9a0
|
@ -773,8 +773,8 @@ type targetScraper struct {
|
||||||
var errBodySizeLimit = errors.New("body size limit exceeded")
|
var errBodySizeLimit = errors.New("body size limit exceeded")
|
||||||
|
|
||||||
const (
|
const (
|
||||||
scrapeAcceptHeader = `encoding=delimited,application/openmetrics-text;version=1.0.0;q=0.75,text/plain;version=0.0.4;q=0.5,*/*;q=0.1`
|
scrapeAcceptHeader = `application/openmetrics-text;version=1.0.0;q=0.75,application/openmetrics-text;q=0.6,text/plain;version=0.0.4;q=0.5,*/*;q=0.1`
|
||||||
scrapeAcceptHeaderWithProtobuf = `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited,application/openmetrics-text;version=1.0.0;q=0.75,text/plain;version=0.0.4;q=0.5,*/*;q=0.1`
|
scrapeAcceptHeaderWithProtobuf = `application/vnd.google.protobuf; proto=io.prometheus.client.MetricFamily; encoding=delimited,application/openmetrics-text;version=1.0.0;q=0.75,application/openmetrics-text;q=0.6,text/plain;version=0.0.4;q=0.5,*/*;q=0.1`
|
||||||
)
|
)
|
||||||
|
|
||||||
var UserAgent = fmt.Sprintf("Prometheus/%s", version.Version)
|
var UserAgent = fmt.Sprintf("Prometheus/%s", version.Version)
|
||||||
|
|
Loading…
Reference in New Issue