Join our Newsletter — 33% off our NHI Course
Home› Glossary› Foundations & NHI Taxonomy› Prometheus Counter
Foundations & NHI Taxonomy

Prometheus Counter

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Foundations & NHI Taxonomy

A Prometheus counter is a metric type that only increases, or resets to zero when a process restarts. It is used to track cumulative events such as requests, errors or bytes processed, and is usually queried as a monotonically increasing time series.

What a Prometheus counter is used for

A Prometheus counter is the right metric when you want to measure cumulative activity over time, not a point-in-time value. It is especially useful for totals that should only go up, such as request counts, error counts, successful jobs, or bytes processed, because monotonic behaviour makes rate-based analysis meaningful.

That makes counters a good fit for operational telemetry where the question is “how much happened?” rather than “what is the current state?” In practice, the value only falls when a process restarts, so resets are expected and must be handled when interpreting graphs or alerts.

Why monotonic metrics matter in observability

Monotonic time series make it possible to derive throughput, error rates, and burst patterns from raw event totals. A counter becomes most valuable when it is paired with functions that convert cumulative growth into rates, since the raw number alone does not tell you how fast the underlying activity is changing.

Counters also help avoid ambiguity. If you track requests, failures, or bytes with a gauge instead, you can lose the distinction between “current level” and “total accumulated events.” That can lead to incorrect dashboards and misleading alert logic, especially when teams try to infer volume from a metric that can move up and down for unrelated reasons.

Common counter patterns and mistakes

Counters are typically incremented by one or by a measured amount, and they are often exposed alongside labels that split the same event across dimensions such as endpoint, outcome, or tenant. The useful pattern is to count a discrete occurrence at the point it happens, then aggregate it later for analysis.

The common mistakes are using a counter for something that can decrease, or assuming the stored value is a live state indicator. Another frequent error is ignoring restarts, which can create sudden drops to zero that are normal for the process but abnormal for the interpretation layer unless the query handles them correctly.

How counters fit into alerting and operational analysis

Counters are foundational for alerting on unusual volume, error spikes, saturation precursors, and service behaviour shifts. A counter alone does not tell you whether a system is healthy, but it provides the raw event history needed to calculate error ratios, request surges, retry storms, and other signals that matter operationally.

They are most effective when paired with consistent naming, stable labels, and careful query design. Because counters are cumulative, the key operational task is not reading the absolute value in isolation, but understanding what that value becomes after rate conversion, aggregation, and reset handling.

Risk and Threat Considerations

Counter misuse is an observability risk because it can hide real failure patterns or create false confidence in dashboards and alerts. If teams model a decreasing quantity as a counter, or fail to account for restarts and label churn, they can miss outages, misread traffic spikes, or undercount error conditions.

Failure mechanism: Query logic that assumes uninterrupted monotonic growth can break when processes restart, metrics are relabelled, or counters are used for stateful values instead of cumulative events.

Impact: Alert thresholds, SLO calculations, and incident triage can become unreliable, which weakens detection and can delay response to performance degradation or service failure.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0DE.CM-01 — Monitoring for Anomalies and EventsCounters feed anomaly monitoring by turning event totals into detectable rates.
PR.DS-01 — Data-at-Rest Is ProtectedMetric data must remain trustworthy and uncorrupted to support operational decisions.
Recommendation — Use counter-derived rates to detect unusual traffic, error, or retry patterns. Protect metric stores and dashboards so counter values remain reliable for analysis.
NIST SP 800-53 Rev 5AU-6 — Audit Record Review, Analysis, and ReportingCounters provide auditable event volume data that supports review and trend analysis.
SI-4 — System MonitoringCounters are a core telemetry primitive for system monitoring and abnormal-activity detection.
Recommendation — Review counter trends alongside logs to validate service behaviour and incident signals. Use counters as monitoring inputs for traffic surges, error spikes, and restart anomalies.
ISO/IEC 27001:2022A.8.15 — LoggingCounters complement logging by summarising cumulative activity for operational oversight.
Recommendation — Correlate counters with logs to confirm event volume, errors, and service resets.

Practitioner Guidance

Why practitioners should care: The practical choice is not just “emit a counter,” but “choose a metric type that matches the question you want answered.” For cumulative event tracking, counters are the safest default because they preserve event history and support rate-based analysis.

What to watch for: Treat any unexpected drop to zero as a signal to inspect process restarts, scrape continuity, and metric semantics rather than assuming the underlying business event stopped. If the value is meant to represent something that can go down, use a different metric type.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org