You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running a Quarkus application with a Prometheus endpoint which will shows the "old" Prometheus format without exemplars when accessing the metrics endpoint in the Chrome browser, and it will show the OpenMetrics output when running it via CURL.
I assume that the content negotiation where Chrome sends among other accepted format "text/html" somehow let's the application go down the path of the old format, while when CURL doesn't send any headers, it chooses the new format.
So I wonder: Can I (or this extension) have Chrome send "application/openmetrics-text" as a supported mime type, so that I will see exemplars in the Chrome window?
The text was updated successfully, but these errors were encountered:
The extension gets the current document request from Chrome and checks if its content type is either "application/openmetrics-text" (or "text/plain" and matching the path names defined). So basically you'd have to take every request matching the "text/plain" content type and try to request the same document as "application/openmetrics-text" again and work from there, which would be quite an overhead.
Also, the content type information you get in the extension itself isn't really great. Prometheus sends content-type: text/plain; version=0.0.4; charset=utf-8; escaping=values which would make it easier to detect Prometheus endpoints in the first place, but all the extension sees is content-type: text/plain.
So at the moment, I'm not really sure how to implement this check in a sensible way, but I'm open to suggestions.
As a short term solution, there seem to be Chrome extensions which can override headers. I just did a quick Google search on "chrome force content type", but haven't looked at any extension in particular.
Also, I haven't worked with exemplars yet, could you please provide some sort of example output so I can check if the highlighting still works correctly?
About the content type: When writing this, I didn't have the response content type in mind, but the accepted types. My browser currently sends something like the following. I wonder if this extension could add application/openmetrics-text to it.
I'm running a Quarkus application with a Prometheus endpoint which will shows the "old" Prometheus format without exemplars when accessing the metrics endpoint in the Chrome browser, and it will show the OpenMetrics output when running it via CURL.
I assume that the content negotiation where Chrome sends among other accepted format "text/html" somehow let's the application go down the path of the old format, while when CURL doesn't send any headers, it chooses the new format.
So I wonder: Can I (or this extension) have Chrome send "application/openmetrics-text" as a supported mime type, so that I will see exemplars in the Chrome window?
The text was updated successfully, but these errors were encountered: