Skip to content

promql (histograms): Issue warning if histogramRate is applied to the wrong kind of histogram #13345

@beorn7

Description

@beorn7

Proposal

In short: The histogramRate function can be applied to gauge histograms and to counter histograms. Ideally, the isCounter argument is true if applied to counter histograms, and it is false if applied to gauge histograms. Otherwise, we should issue a warning via the new annotation system.

See relevant TODOs in the code:

The broad plan would be to issue the warning in the following two cases:

  • isCounter is false but the first or the last histogram in the range is not a gauge histogram.
  • isCounter is true but at least one histogram in the range is a gauge histogram.

The good thing here is that we know precisely if a histogram is a gauge histogram or a counter histogram. It's not just a naming convention we have to rely on like for float samples.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions