Skip to content

Prometheus metrics violate counter monotonicity convention: _count and _sum reset on every scrape due to ResettingSample #34628

@lake-dunamu

Description

@lake-dunamu

All Prometheus histogram metrics using ResettingSample have broken _count and _sum values. They decrease on every scrape instead of monotonically increasing, which violates the Prometheus counter type spec and breaks rate(),
increase(), and average latency calculations.

https://prometheus.io/docs/concepts/metric_types/#counter

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.

Should we fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions