-
Notifications
You must be signed in to change notification settings - Fork 820
Closed
Description
The latest
(2.30.0) version of Prometheus sends out the following request when scraping:
GET /actuator/prometheus HTTP/1.1
Host: host.docker.internal:8080
User-Agent: Prometheus/2.30.0
Accept: application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1
Accept-Encoding: gzip
X-Prometheus-Scrape-Timeout-Seconds: 10
In the Accept
header, the version of openmetrics-text
is 0.0.1
(see scrape.go
).
In the Java client, the Content-Type
constant does not match to this, its version is 1.0.0
(see TextFormat
):
CONTENT_TYPE_OPENMETRICS_100 = "application/openmetrics-text; version=1.0.0; charset=utf-8";
The python client uses 0.0.1
too. Shouldn't all use the same version (1.0.0
) or should the Java client use (0.0.1
)?
It also seems that TextFormat::chooseContentType
takes this into account:
client_java/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java
Lines 37 to 41 in 7a29af0
for (String accepts : acceptHeader.split(",")) { | |
if ("application/openmetrics-text".equals(accepts.split(";")[0].trim())) { | |
return CONTENT_TYPE_OPENMETRICS_100; | |
} | |
} |
Metadata
Metadata
Assignees
Labels
No labels