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
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).
  • When I query the metric type using the API endpoint /api/v1/metadata?metric=<metric_name> for the affected metrics, I get an empty result ({}), which suggests the type metadata isn’t being stored in its cache or recognized by Prometheus for these metrics.
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
to Vu Nguyen, Prometheus Users
You have hit https://github.com/prometheus/prometheus/issues/13944

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
to Prometheus Users
Thanks Björn for the quick reply. That explains the issue. I’ll keep an eye on it.

Appreciate the help!
Reply all
Reply to author
Forward
0 new messages