Prefer 1.0.0 in the accept header for application/openmetrics-text (#9431)

related: https://github.com/prometheus/client_java/issues/702
fixes gh-9430

Signed-off-by: Jonatan Ivanov <jonatan.ivanov@gmail.com>
This commit is contained in:
Jonatan Ivanov 2022-01-27 15:37:51 -08:00 committed by GitHub
parent 4cc369ed1a
commit b6df3b6f67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -748,7 +748,7 @@ type targetScraper struct {
var errBodySizeLimit = errors.New("body size limit exceeded") var errBodySizeLimit = errors.New("body size limit exceeded")
const acceptHeader = `application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1` const acceptHeader = `application/openmetrics-text;version=1.0.0,application/openmetrics-text;version=0.0.1;q=0.75,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)