prometheus_tsdb_head_series

Just because I always forget and have to Google this, and this question is at the top. As per this answer there will likely be a variance between prometheus_tsdb_head_series & count({__name__=~".+"}) because of variations in what they consider "active", but unless you have a large variability in metric count, I'd recommend prometheus_tsdb_head_series because if you have a lot of metrics, it's a lot faster to query.

Answer from Glenn Slaven on serverfault.com
🌐
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.

Filter for prometheus metrics Dec 3, 2022
r/kubernetes
3y ago
Prometheus Counters - and how to deal with them May 20, 2019
r/PrometheusMonitoring
7y ago
Scrape Prometheus remote write metrics Jan 13, 2025
r/PrometheusMonitoring
last yr.
Metric for down or not scraping targets Aug 5, 2024
r/PrometheusMonitoring
2y ago
How does scraping /metrics work in detail? Nov 11, 2025
r/PrometheusMonitoring
9mo ago
More results from reddit.com
🌐
OpenObserve
openobserve.ai › home › blog › prometheus metrics count basics
Prometheus Metrics Count Basics
September 26, 2025 - Before writing Prometheus queries, it’s important to know what exactly we’re counting. Prometheus data is built on two concepts: metrics and labels. Metrics are the actual measurements you collect. Examples include: http_requests_total → total number of HTTP requests
Discussions

How is it possible to know the total number of unique metrics in Prometheus - Stack Overflow
The metric is added in a central place from the app and at any point, we will be having different combinations of the labels leading to different time series. ... We want to monitor the number of different time series that exist at any point in time i.e. we are looking for a unique count of all the unique combination of labels. Is there a way we can access this using a Prometheus ... More on stackoverflow.com
🌐 stackoverflow.com
Number of metrics one Prometheus server can handle?
Hi all, I’m doing a project where we would like to monitor IoT devices. We plan to follow the design described here: Each IoT device will report their metrics to PubSub and There will be one PubSub receiver instance listening to all the device and updating the metrics. More on discuss.prometheus.io
🌐 discuss.prometheus.io
3
1
May 18, 2021
How do I show the count of a specific group of metrics from a prometheus histogram? - Stack Overflow
3 How can I calculate the number of metrics by unique labels without specifying a label in Prometheus/Grafana? 1 Count labels for which two metrics meet criteria More on stackoverflow.com
🌐 stackoverflow.com
Prometheus: Count metric value over a period of time - Stack Overflow
There is another Prometheus-like system, which allows counting the number of raw samples with the given value on the specified lookback window - VictoriaMetrics (I'm the core developer of this system). It provides count_eq_over_time function for this task. For example, the following MetricsQL query ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Mkaz
mkaz.me › blog › 2023 › simple-prometheus-queries-for-metrics-inspection
Simple Prometheus queries for metrics inspection | Michal Kazmierczak
Now, let’s check how many metrics our Prometheus instance maintenances. ... Nothing out of ordinary, it’s just a grouping the previous query by __name__ and counting it. Similarly, let’s check the number of jobs that produce metrics.
🌐
Prometheus
prometheus.io › docs › concepts › metric_types
Metric types | Prometheus
There is also ongoing work to persist the type information of the simple float samples. A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.
🌐
VictoriaMetrics
victoriametrics.com › blog › prometheus metrics explained: counters, gauges, histograms & summaries
Prometheus Metrics Explained: Counters, Gauges, Histograms & Summaries
February 21, 2025 - That said, the idea of metric types still helps make sense of what’s being tracked. A counter does exactly what you’d expect—it counts things. It only increases (or resets to zero) and never goes down. This makes counters perfect for tracking things that continuously grow, like the number of requests hitting a server, the number of errors logged, or the total transactions processed.
Find elsewhere
🌐
Prometheus
discuss.prometheus.io › prometheus server
Number of metrics one Prometheus server can handle? - Prometheus server - Prometheus Monitoring System
May 18, 2021 - Hi all, I’m doing a project where we would like to monitor IoT devices. We plan to follow the design described here: Each IoT device will report their metrics to PubSub and There will be one PubSub receiver instance lis…
🌐
Google Groups
groups.google.com › g › prometheus-users › c › 5LmkR3clOI0
Count Samples per Metrics
This means that time series and number of samples are not proportional. Is there any way of getting the total amount of samples of each metric? ... Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message ... You can use count_over_time for this. Note that having multiple scrape intervals within one Prometheus is not recommended for the sake of sanity.
🌐
HexDocs
hexdocs.pm › prometheus_ex › Prometheus.Metric.Counter.html
Prometheus.Metric.Counter — Prometheus.ex v5.1.0
Counter is a Metric that represents a single numerical value that only ever goes up. That implies that it cannot be used to count items whose number can also go down, e.g. the number of currently running processes. Those "counters" are represented by Prometheus.Metric.Gauge.
🌐
Promlabs
promlabs.com › blog › 2020 › 12 › 17 › promql-queries-for-exploring-your-metrics
PromLabs | Blog - PromQL Queries for Exploring Your Metrics
December 17, 2020 - To get a feeling where "all those series" are coming from, you can write PromQL queries to count how many series there are for a given job, instance (target), metric name, or other type of dimensional grouping.
🌐
SigNoz
signoz.io › guides › how to count unique label values with prometheus queries
How to Count Unique Label Values with Prometheus Queries | SigNoz
September 6, 2024 - Understanding its usage and combining it with other functions is key to getting the most out of your Prometheus metrics. ... The count() function is designed to aggregate the number of metrics that match a given set of labels.
🌐
Better Stack
betterstack.com › community › questions › get-total-requests-in-time-period
Get Total Requests in a Period of Time | Better Stack Community
February 26, 2025 - To calculate the total number of requests over a specified period of time using Prometheus, you can utilize the increase function. This function is ideal for summing up the total count of a counter metric over a given time interval.
🌐
Better Stack
betterstack.com › community › questions › prometheus-to-count-unique-label-values
Prometheus Query to Count Unique Label Values | Better Stack Community
December 2, 2024 - Let’s say you have a metric called http_requests_total that includes a label named instance. You want to count how many unique instances are being tracked. ... count(http_requests_total): This part of the query counts the number of occurrences of the http_requests_total metric across all instances.
🌐
GitConnected
levelup.gitconnected.com › prometheus-counter-metrics-d6c393d86076
Working With Prometheus Counter Metrics | Level Up Coding
February 28, 2022 - Here we have the same metric but this one uses rate to measure the number of handled messages per second. ... As one would expect, these two graphs look identical, just the scales are different. Which one you should use depends on the thing you are measuring and on preference. In this example, I prefer the rate variant. I think seeing we process 6.5 messages per second is easier to interpret than seeing we are processing 390 messages per minute. The Prometheus counter is a simple metric, but one can create valuable insights by using the different PromQL functions which were designed to be used with counters.
🌐
Chronosphere
chronosphere.io › home › an introduction to the 4 primary prometheus metrics types
An introduction to the 4 primary Prometheus metrics types
April 2, 2025 - Counter metricss are running or cumulative counts with metric client libraries that keep an ever-increasing total sum of the number of events for the lifetime of the application. These events can be periodically measured by having Prometheus scrape the metrics endpoint exposed by a client library.
🌐
Prometheus
prometheus.io › docs › tutorials › understanding_metric_types
Understanding metric types | Prometheus
Counter is a metric value that can only increase or reset i.e. the value cannot reduce than the previous value. It can be used for metrics like the number of requests, no of errors, etc.
🌐
Last9
last9.io › blog › prometheus-metrics-types-a-deep-dive
Prometheus Metrics Types - A Deep Dive | Last9
June 17, 2026 - For finding the worst offenders, see how to manage high cardinality metrics in Prometheus. Histograms and summaries expose more than one time series. The _count series is the total number of observations, and _sum is the total of all observed values, so _sum / _count gives the average.