The following query lists all available metrics:
sum by(__name__)({app="bar"})
Where bar is the application name, as you can see in the log entries posted in the question.
OpenObserve
openobserve.ai › home › blog › prometheus metrics count basics
Prometheus Metrics Count Basics
September 26, 2025 - These data points are stored as time series, and each unique combination of metric name and labels becomes a separate time series. When you run a count query, Prometheus looks at all the relevant time series and performs calculations on them. This architecture is why Prometheus is so fast at handling large amounts of time-series data, but it also explains why counting unique values requires special techniques. count(count by (status_code) (http_requests_total))
Prometheus
prometheus.io › docs › concepts › metric_types
Metric types | Prometheus
Similar to a histogram, a summary samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window. A summary with a base metric name of <basename> exposes multiple time series during a scrape:
How to get a total number of metrics scraped by Prometheus?
The “prometheus_tsdb_head_series” metric may be what you’re looking for. Also check out the “tsdb analyze” command in promtool for some more TSDB insights. More on reddit.com
Prometheus: grouping metrics by metric names - Stack Overflow
I have also tried to use wildcard in the metric name, prometheus is complaining about that. Looking at the metrics, I can see that some of them have dynamic names, most probably delivered by dropwizard metrics. More on stackoverflow.com
DataDog Custom Metrics
What an absolute mess DD's custom metrics are. Have they guilded the dumpster fire over and over? New Relic's costs are such a breath of fresh air. All data charged at the same rate is simply much more understandable. More on reddit.com
Sort query by name
You could use Grafana built in transformations to sort the results More on reddit.com
Promlabs
promlabs.com › blog › 2020 › 12 › 17 › promql-queries-for-exploring-your-metrics
PromLabs | Blog - PromQL Queries for Exploring Your Metrics
December 17, 2020 - If your UI does not already show you this list in one way or another (it really should!), you can query for it by first selecting all series, then grouping by the special metric name label __name__: ... Note: A more efficient, non-PromQL way to get the same information is to use Prometheus's label values metadata endpoint to get all values for the __name__ label, e.g.: https://demo.promlabs.com/api/v1/label/name/values.
Reddit
reddit.com › r/prometheusmonitoring › how to get a total number of metrics scraped by prometheus?
r/PrometheusMonitoring on Reddit: How to get a total number of metrics scraped by Prometheus?
September 2, 2021 -
Hi,
I'm trying to troubleshoot Prometheus high memory usage. While I can view my top x metrics with high cardinality, to get an idea, I want to know the total number of metrics that prometheus is currently storing in tsdb. Is there a query that can be useful here?
Thanks In advance.
Top answer 1 of 3
57
The following query lists all available metrics:
sum by(__name__)({app="bar"})
Where bar is the application name, as you can see in the log entries posted in the question.
2 of 3
23
{__name__=~".+"} will return all non-stale time series, however this is an expensive query and should be generally avoided.
Mkaz
mkaz.me › blog › 2023 › simple-prometheus-queries-for-metrics-inspection
Simple Prometheus queries for metrics inspection | Michal Kazmierczak
For starters, let’s pull the total number of series. That is the count of all unique label combinations (including the __name__ label). ... This query relies on one simple rule: Prometheus Query Language (PromQL) requires to provide either a metric name or at least one label matcher.
Prometheus
prometheus.io › docs › prometheus › latest › querying › examples
Query examples | Prometheus
Return the per-second rate for all time series with the http_requests_total metric name, as measured over the last 5 minutes: ... Assuming that the http_requests_total time series all have the labels job (fanout by job name) and instance (fanout by instance of the job), we might want to sum over the rate of all instances, so we get fewer output time series, but still preserve the job dimension:
GitHub
github.com › prometheus › docs › blob › main › docs › concepts › metric_types.md
docs/docs/concepts/metric_types.md at main · prometheus/docs
Similar to a histogram, a summary samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window. A summary with a base metric name of <basename> exposes multiple time series during a scrape:
Author: prometheus
Prometheus
prometheus.io › docs › practices › naming
Metric and label naming | Prometheus
Also note that this applies to units in the narrow sense (like the units in the table below), but not to countable things in general. For example, connections or notifications are not considered units for this rule and do not have to be at the end of the metric name.
Better Stack
betterstack.com › community › guides › monitoring › prometheus-metrics-explained
A Practical Guide to Prometheus Metric Types | Better Stack Community
Metrics are typically exposed by applications on HTTP endpoints (typically /metrics), and scraped periodically by Prometheus. This pull-based model ensures that Prometheus has control over data collection frequency and consistency. Prometheus offers four core metric types to capture diverse system behaviors: Counters for tracking ever-increasing values, like the total number of exceptions thrown.
client_python
prometheus.github.io › client_python › instrumenting › counter
Counter | client_python
April 9, 2026 - This is for compatibility between OpenMetrics and the Prometheus text format, as OpenMetrics requires the _total suffix. Counter(name, documentation, labelnames=(), namespace='', subsystem='', unit='', registry=REGISTRY) namespace, subsystem, and name are joined with underscores to form the full metric name:
Robust Perception
robustperception.io › which-are-my-biggest-metrics
Which are my biggest metrics? – Robust Perception | Prometheus Monitoring Experts
December 16, 2015 - To know which metrics are using the most resources it'd be good to count how many time series each has, and then display the top 10. This can be done with an expression selecting all metrics, aggregating a count based on the metric name and returning the top 10 in the expression browser (make ...
client_java
prometheus.github.io › client_java › getting-started › metric-types
Metric Types | client_java
For the default OpenMetrics 1.0 and Prometheus text formats, counters are exposed with the _total suffix. You can name a counter either service_time_seconds or service_time_seconds_total; the exposed name will be service_time_seconds_total in both cases. The experimental OpenMetrics 2.0 writer ...
Google Groups
groups.google.com › g › prometheus-users › c › 5LmkR3clOI0
Count Samples per Metrics
to Prometheus Users · So far, we have a promql query that shows the total amount of time series per metric (count by (__name__)({__name__=~".+"})) and also per target(scrape_samples_scraped). We also can take the total amount of chunk samples ( prometheus_tsdb_compaction_chunk_samples_count).