Metric Types not displaying in Prometheus GUI for Java and Python targets
99 views
Skip to first unread message
Vu Nguyen
unread,
Mar 3, 2025, 10:44:10 AM3/3/25
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
I’m reaching out to get some guidance or insights to troubleshoot an issue I’ve encountered with the Prometheus GUI (Prometheus v2.51).
I have Prometheus targets instrumented with Java (using https://github.com/prometheus/client_java/releases/tag/v1.3.5). When scraping these targets, the metrics are collected successfully, and I can query them via PromQL. However, when I type these metric names into the Prometheus GUI’s query box, the metric types (e.g., counter, gauge) for some of these metrics do not appear on the right side of the auto-completion list as expected. For other metrics from the same targets, the types show up fine, so it seems inconsistent.
Here’s what I’ve checked so far:
The /metrics endpoints of the targets include # TYPE lines for all metrics (e.g., # TYPE http_requests_total counter), and they look correctly formatted.
The Prometheus server scrapes these endpoints without errors (scrape status is "up" in the targets page).
WhenIquerythemetrictypeusingtheAPIendpoint/api/v1/metadata?metric=<metric_name>fortheaffectedmetrics,Igetanemptyresult({}),whichsuggeststhetypemetadataisn’tbeingstored in its cache orrecognizedbyPrometheusforthesemetrics.
Has anyone else run into this behavior? Could it be related to the client library, the Prometheus server version?
I’d appreciate any pointers on troubleshooting this
Bjoern Rabenstein
unread,
Mar 4, 2025, 12:59:15 PM3/4/25
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
It seems consensus that Prometheus should assume foo_total as the
metric name in the metadata API if a counter named "foo" is ingested
via OpenMetrics v1. We just need someone to implement it. PRs welcome.
--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Vu Nguyen
unread,
Mar 5, 2025, 8:43:09 AM3/5/25
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
Thanks Björn for the quick reply. That explains the issue. I’ll keep an eye on it.