🌐
Prometheus
prometheus.io › docs › concepts › metric_types
Metric types | Prometheus
In the future, Prometheus might ... 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....
🌐
Prometheus
prometheus.io › docs › tutorials › understanding_metric_types
Understanding metric types | Prometheus
Join PromCon EU 2026 , the Prometheus users conference, on October 7–8, 2026 in Munich. PromCon EU 2026 — Oct 7–8, Munich. ... Counter is a metric value that can only increase or reset i.e. the value cannot reduce than the previous value.
People also ask

How do Counter metrics work in Prometheus?
Counter metrics represent a running total of event occurrences. Prometheus scrapes the value at regular intervals, and PromQL can compute the rate of change or increase over time, even across counter resets.
🌐
last9.io
last9.io › blog › prometheus-metrics-types-a-deep-dive
Prometheus Metrics Types - A Deep Dive | Last9
How does the Prometheus counter metric type work?
A counter increases monotonically. It tracks events like API hits, background job runs, or errors. When the process restarts, the counter resets, but functions like rate() account for the reset.
🌐
last9.io
last9.io › blog › prometheus-metrics-types-a-deep-dive
Prometheus Metrics Types - A Deep Dive | Last9
What are Prometheus metrics?
Prometheus metrics are structured time series built on a flexible data model. Each metric includes a name, labels, a sample value, and a timestamp. Samples are collected at intervals and queried using PromQL.
🌐
last9.io
last9.io › blog › prometheus-metrics-types-a-deep-dive
Prometheus Metrics Types - A Deep Dive | Last9
🌐
Reddit
reddit.com › r/prometheusmonitoring › prometheus counters very unreliable for many use-cases, what do you use instead?
r/PrometheusMonitoring on Reddit: Prometheus counters very unreliable for many use-cases, what do you use instead?
April 14, 2025 -

My team switched from datadog to prometheus and counters have been the biggest pain-point. Things that just worked without thinking about it in datadog doesn't seem to have good solutions in prometheus. Surely we can't be the only ones hitting our head against the wall with these problems? How are you addressing them?

Specifically for use-cases around low-frequency counters where you want *reasonably* accurate counts. We use Created Timestamp and have dynamic labels on our counters (so pre-initializing counters to zero isn't viable or makes the data a lot less useful). That being said, these common scenarios have been a challenge:

  • Alerting on a counter increase when your counter doesn't start at zero. We use Created Timestamp gives us more confidence but it worries me that a bug/edge-case will cause us to miss an alert. Catching that would be difficult.

  • Calculating the total number of increments in a time period (ex: $__range). Sometimes short-lived series aren't counted towards the total.

  • Viewing the frequency of counter increments over time as a time series. Seems like aligning the rate and step helps but I'm still wary about the accuracy. It seems like for some time ranges it doesn't work correctly.

  • For calculating a success rate or SLI over some period of time. The approach of `sum(rate(success_total[30d])) / `sum(rate(overall_total[30d]))` doesn't always work if there are short-lived series within the query range. I see Grafana SLO feature uses recording rules, which I hope(?) improves this accuracy, but its hard to verify and is a lot of extra steps (i.e. `sum(sum_over_time((grafana_slo_success_rate_5m{})[28d:5m])) / sum(sum_over_time((grafana_slo_total_rate_5m{} )[28d:5m]))`

A lot of teams have started using logs instead of metrics for some of these scenarios. Its ambiguous when its okay to use metrics and when logs are needed, which undermines the credibility of our metrics' accuracy in general.

The frustrating thing is it seems like all the raw data is there to make these use-cases work better? Most of the time you can manually calculate the statistic you want by plotting the raw series. I'm likely over-simplifying things, and I know there's complicated edge-cases around counter-resets, missed scrapes, etc., however promql is more likely to understate the `rate`/`increase` to account for that. If anything, it would be better to overstate the `rate` since its safer to have a false positive than false negative for most monitoring use-cases. I rather have grafana widgets or promql that works for the majority of times you don't hit the complicated edge cases but overstates the rate/increase when that does happen.

I know this comes across as somewhat of a rant so I just want to say I know the prometheus maintainers put a lot of thought into their decisions and I appreciate their responsiveness to helping folks here and on slack.

Top answer
1 of 2
12
You're absolutely correct. Very slow moving counters are a difficult issue with Prometheus. What we do: Reduce the cardinality for important SLO metrics We try not to include "debugging level" labels. Too many teams try and add ever single label dimension they would want in debugging which makes the couting very sparse. Metrics are designed to tell you that there is a problem at X time. It's meant to notify you that you should go look in the logs for the actual errors. If your error metrics have labels, maybe re-think their use. For singleton use timestamp metrics I've seen some teams use counters for cron job like things that should be using job_started_timestamp_seconds or job_completed_timestamp_seconds, etc. Use accumulator exporters For some things we actually end up using push with statsd to a single accumulator that Prometheus scrapes. This is typically for queue dispatched workers. The modern approach would be to use something like OTel cumulative deltas and a single Otel aggregation collector. Personally I wish teams would stop over-leaning on queue dispatched ephemeral workers. It's much more reliabile and efficient to have long-running workers than workers that only last a few seconds or minutes. IMO, the whole "FaaS" thing is a bad fad in the industry. It's cute, but when I put on my SRE hat, it says nope. Long term idea I have a long-term idea to add a new metrics pipeline within Promethus itself. My marketing name for this is "Materialized Metrics". Essentially taking counter scrapes and turning them back into deltas. Then you specify which lables to sum by /without () and turns them back into counters. This way you can do things like drop instance or other labels from the counters and get back a single counter projection that doesn't suffer as much from the extrapolation errors. I'm still working on the design doc, there are a lot of edge cases and things to think about. EDIT to add I think your title statement is a bit clickbait. "very unreliable for many use-cases" is exaggeration / hyperbole. Normal counters are very reliable for almost all use cases. Especially when following Prometheus best practices.
2 of 2
3
How do you write data into prometheus? Scraping? Remote writes? I use Prometheus as a database for fio metrics with 1s update interval, and it works great. If you do scraping, rate of scraping is defining how well your data are represented. There is no proper way to handle situation when metric 'starts' not at the 0. You can emulate it a bit with logic, but it will be flawed. Normal Prometheus use imply, that you either worry about actual value (for gauges) or worry about increments, may be, increments over time. A lot of short-lived metrics is an anti-pattern for Prometheus. Reduce cardinality, remove excessive labeling via rewriting rules. Use of recording rules is more reliable than you think, if you cover your recording rules with a proper unit tests (promtool test rules). Write a good tests, set up few alerts for slow recording rules processing and you can be sure, that they work reliably. Contrary: no tests and no alerts, you get a broken monitoring which checks ...something. One problem with Prometheus: it uses floats, so counts are not 100% accurate, especially, if you do '+1' for large numbers. At some value you can't do +1 anymore (around 1052, I belive, 1052+1 == 1052).
🌐
VictoriaMetrics
victoriametrics.com › blog › prometheus metrics explained: counters, gauges, histograms & summaries
Prometheus Metrics Explained: Counters, Gauges, Histograms & Summaries
February 21, 2025 - Metrics come in different types: counters that only increase, gauges that fluctuate, histograms that show value distributions, and summaries that pre-calculate …
🌐
Last9
last9.io › blog › prometheus-metrics-types-a-deep-dive
Prometheus Metrics Types - A Deep Dive | Last9
June 17, 2026 - You don’t need to add one manually, and doing so just creates unnecessary churn. Counters track values that only go up. They’re used to record totals, events like HTTP requests served, background jobs completed, or errors encountered.
🌐
OpenObserve
openobserve.ai › home › blog › prometheus metrics types
Prometheus Metric Types (Counters, Gauges, Histograms, Summaries)
November 19, 2025 - Prometheus provides four fundamental ... for effective instrumentation and monitoring. A Counter is a metric that only increases over time (or resets to zero on restart)....
🌐
Robust Perception
robustperception.io › how-does-a-prometheus-counter-work
How does a Prometheus Counter work? – Robust Perception | Prometheus Monitoring Experts
April 8, 2016 - Prometheus takes the third approach. A counter starts at 0, and is incremented. The client does no other calculations. At each scrape Prometheus takes a sample of this state. The rate() function in Prometheus looks at the history of time series over a time period, and calculates how fast it's ...
Find elsewhere
🌐
client_java
prometheus.github.io › client_java › getting-started › metric-types
Metric Types | client_java
The Prometheus Java metrics library implements the metric types defined in the OpenMetrics standard: Counter is the most common and useful metric type. Counters can only increase, but never decrease.
🌐
Medium
jacksonblog.medium.com › prometheus-metrics-type-1190c181c382
Prometheus metrics type. · Overview · Counter ∘ rate( ) ∘… | by Jackson Chen | Medium
March 3, 2024 - When the process being scraped restarts, Counter metrics may reset to 0. However, the rate() function automatically handles this issue. When the value of the Counter metric is reduced, it is considered as a reset, and subsequent samples are adjusted accordingly.
🌐
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.
🌐
Javadoc.io
javadoc.io › doc › io.prometheus › simpleclient › 0.4.0 › io › prometheus › client › Counter.html
Counter (Prometheus Java Simpleclient 0.4.0 API)
Latest version of io.prometheus:simpleclient · https://javadoc.io/doc/io.prometheus/simpleclient · Current version 0.4.0 · https://javadoc.io/doc/io.prometheus/simpleclient/0.4.0 · package-list path (used for javadoc generation -link option) https://javadoc.io/doc/io.prometheus/simpleclient/0.4.0/package-list ·
🌐
Rust
docs.rs › prometheus › latest › prometheus › type.Counter.html
Counter in prometheus - Rust
prometheus · Source · pub type Counter = GenericCounter<AtomicF64>; Expand description · A Metric represents a single numerical value that only ever goes up.
🌐
Last9
last9.io › blog › prometheus-gauges-vs-counters
Prometheus Gauges vs Counters: What to Use and When | Last9
February 21, 2026 - Choosing the wrong metric type in Prometheus can lead to inaccurate dashboards, false positives in alerting, and missed indicators of system failure. Gauge metrics are intended for tracking values that can go up and down, such as memory usage, queue depth, or the number of active connections. Unlike counters, which only increment (or reset on restart), gauges reflect the current state of a resource at scrape time.
🌐
Torsten Mandry
torstenmandry.github.io › Prometheus-Counters
Prometheus Counters and how to deal with them | Torsten Mandry
May 20, 2019 - If we execute this query, we would expect to get the value 60 as a result, because our counter is increased by 1 every 5 seconds over the last 5 minutes. What we really get is something like 59.035953240763114. How come? Prometheus scraps its targets on a regular basis.
🌐
Jasonstitt
jasonstitt.com › prometheus-counters-dont-exist
Prometheus counters don't exist (and what they really do) - Jason Stitt
May 13, 2023 - A counter is, server-side, a gauge. The increment is handled entirely client-side (on the sending side). Let’s look at an example. Here’s some Prometheus client code that publishes a gauge and a counter:
🌐
Medium
pramodshehan.medium.com › prometheus-counter-metrics-1b0a4cbb79e1
Prometheus Counter metrics. There are three functions to calculate… | by Pramod Shehan | Medium
January 18, 2026 - We can calculate the actual increase by adding the counter value before the reset to the new counter value after the reset (see Figure 02). In Prometheus, this is handled more efficiently internally and does not require generating a full list of corrected samples.
🌐
SigNoz
signoz.io › guides › how to manage prometheus counters - best practices for servers
How to Manage Prometheus Counters - Best Practices for Servers | SigNoz
July 25, 2024 - Understand counter behavior: Counters only increase or reset to zero. Handle resets properly: Use Prometheus functions like increase() and rate().
🌐
OneUptime
oneuptime.com › home › blog › how to implement prometheus counter best practices
How to Implement Prometheus Counter Best Practices
January 30, 2026 - Counters MUST only increase. This guarantee enables Prometheus to detect resets and compute accurate rates across restarts.
🌐
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 - They are used to track and measure Prometheus metrics with continually – or monotonically – increasing values which get exposed as time series. An example of a counter metric is http_requests_total, which reports the running total of HTTP ...