
- Monotonic metric: Value only increases (e.g., cumulative counters).
- Non-monotonic metric: Value can increase and decrease (e.g., gauges).
- Monotonic: an electricity meter or an HTTP request counter — readings only go up.
- Non-monotonic: a speedometer or thermometer — readings go up and down.

- Use a
Counterfor monotonically increasing measurements and aggregate asSum(often used to compute deltas or rates). - Use a
GaugeorObservableGaugefor measurements that can go up and down and aggregate asLastValue(to represent the current state).
| Instrument | Typical aggregation | Typical use case |
|---|---|---|
Counter | Sum | Total number of requests, retries, bytes sent |
Gauge / ObservableGauge | LastValue | Current CPU usage, memory usage, queue length |
Histogram | Distribution / Buckets | Latency distributions, payload sizes |



- Monotonic Counter (OpenTelemetry-like pseudocode)
- Non-monotonic Gauge (OpenTelemetry-like pseudocode)
- If the measurement only ever increases, treat it as monotonic: use
Counterand aggregate asSum. - If it can go up and down, treat it as non-monotonic: use
Gauge/ObservableGaugeand aggregate asLastValue.
Choosing the correct instrument and aggregation for monotonic vs. non-monotonic metrics ensures accurate downstream calculations (for example, computing rates, deltas, or current-state snapshots). This improves alerting, dashboards, and capacity planning.
Do not model decreasing values with a
Counter. Treating non-monotonic data as monotonic leads to incorrect sums, rates, and alerts. If you need to represent decreases, use a Gauge or an appropriate observable instrument.- OpenTelemetry Metrics Specification
- OpenTelemetry Instrumentation Concepts
- Monitoring Best Practices: Counters vs Gauges