-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content negotiation is broken for expfmt and for promhttp #456
Comments
@roidelapluie Could you please help out here a little? |
Hi this is a valid bug. And the only reason nobody noticed it because Prometheus also sends https://github.com/prometheus/prometheus/blob/main/scrape/scrape.go#L775 I'll send a PR fixing it now. |
I'm aware (I made that change). Since the OpenMetrics output is not necessarily scraped by Prometheus and the OpenMetrics spec says this:
I guess this is mostly about following the specs and other consumers being broken. |
According to this comment on OTel's Prometheus exporter
expfmt
andpromhttp
are returning the wrong format ifopenmetrics-text 1.0.0
is requested. It seemsopenmetrics-text 1.0.0
is not supported onlyopenmetrics-text 0.0.1
is.If a user requests
openmetrics-text 1.0.0
:The expected result should be in the OpenMetrics format, also the content-type should be:
But the result is in Prometheus plaintext format, the content-type says the same:
If a user requests
openmetrics-text 0.0.1
:The result is in the expected OpenMetrics format:
As far as I know,
0.0.1
should not be used, only1.0.0
.According to the OpenMetrics specs:
Also the Prometheus server uses 1.0.0 for scraping: prometheus/prometheus#9430
The text was updated successfully, but these errors were encountered: