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 does not recognize HELP
and TYPE
for OpenMetrics counters
#13944
Comments
Related, another OpenMetrics counter incompatibility: #6541 |
Could you verify what protocol is actually used in the Prometheus scrape? (I believe this particular aspect of OpenMetrics should be implemented correctly in Prometheus, and my suspicion here is that Prometheus, for some reason, thinks it is scraping the classic text format, or it might even negotiate protobuf, maybe because native histograms are enabled…) |
How can I verify which protocol is used? It is not printed in debug logs. I changed scrape config like this and ran
|
For ground truth, I would use a packet sniffer like tcpdump or Wireshark. |
I have reproduced the issue now. tl;dr: @link2xt is right. The UI isn't properly creating a type hint for counters ingested via OpenMetrics. This is a UI issue. The UI is querying the /api/v1/metadata endpoint, and for counters that are ingested via OpenMetrics, it returns something like this for a counter that creates a metric "request_processing_seconds": [
{
"type": "counter",
"unit": "",
"help": "Time spent processing request"
} The UI in this case is only looking for an entry First question to OM experts @RichiH and @SuperQ : Is the metadata endpoint behaving as expected here? And in case it is, this would be an issue to be fixed by our frontend experts (@Nexucis and @juliusv, maybe). |
I suppose we should make the metadata endpoint match the expected Prometheus name when exposing OM metrics output for counters. |
Some musings about the question if the metadata API is behaving correctly: I think it's really problematic that the exposition format now determines how a counter is represented in the metadata API response. I get the rationale behind OM's decision to change the "true name" of a counter metric However, with native histograms as the histogram of choice, the classic histograms might just become a thing of the past. Even summaries, if we still want to support them, could eventually be represented by "native summaries" (no concrete plans, just a reasonable speculation). Then there would be no footsteps to follow anymore and we could "go back" to calling a counter |
So you would say we should change the example output above to say This would work if we do it at the level of ingesting metadata. We cannot really do it after the fact in the metadata API itself because, at that point, we don't know anymore which format was used to ingest the metric. |
What did you do?
I pointed Prometheus to OpenMetrics endpoint which outputs data that looks like this:
Endpoint is provided by https://github.com/deltachat/notifiers which uses https://github.com/prometheus/client_rust
What did you expect to see?
I expected that Prometheus would display "counter" hint and help line "Number of direct notifications." However, Prometheus ignores
HELP
andTYPE
fordirect_notifications
.Apparently it expected that response would contain:
but this is not correct according to OpenMetrics specification. This is the difference documented in https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/
What did you see instead? Under which circumstances?
I expected that OpenMetrics parser would be used according to the content-type and recognize HELP and TYPE for
direct_notifications_total
counter.System information
Linux 5.15.0-102-generic x86_64
Prometheus version
Prometheus configuration file
The text was updated successfully, but these errors were encountered: