-
Notifications
You must be signed in to change notification settings - Fork 557
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
Prometheus fails to scrape Helidon metrics #111
Comments
The issue appears to be that Prometheus sends an
So it is requesting The point is that Helidon will generate JSON in this case, and not Prometheus text. This is because of this method:
Since the request headers will accept JSON, we generate JSON. The logic needs to be more sophisticated. Since Prometheus prefers text/plain, that's what we should generate. To be explicit: If the Accept header is If the Accept header is |
Interesting, I agree. Take a look at |
I have requested clarification from Metrics spec on media types: My current understanding of the spec would mean that we cannot change the behavior as requested by this issue. |
Thanks for asking for clarification. I hope this is a case of the MicroProfile spec being sloppy because the current behavior means that MicroProfile apps (and by extension Helidon apps) can't be scraped by Prometheus -- which is absurd. |
@barchetta I agree. The spec may need to be clarified, but I doubt their intent was to ignore quality factors in an |
We have confirmation from MicroProfile that the spec is misleading: "I'm part of the metrics community and I agree that what's specified in section 2.3, related to the Accept header isn't as specific as it ought to be. The way it's worded in the spec right now isn't right, as illustrated by Joe's example. The way we'd intended for it to be interpreted was that if the incoming request accepts text/plain with a higher priority than application/json, then you should use Prometheus format. If the incoming request accepts application/json with a higher priority than text/plain, then use JSON format. If the incoming request doesn't accept either of those, then return a 406 status code." There is now an issue to clarify this in the spec: eclipse/microprofile-metrics#291 |
Environment Details
Problem Description
Prometheus 2.2.1 and 2.4.3 fail to scrape Helidon metrics. Prometheus reports the error
no token found
. This error is typically reported by Prometheus when it can't parse the scrapped metrics data.Steps to reproduce
You'll see prometheus report:
The text was updated successfully, but these errors were encountered: