8000 Native histograms: unary minus and negative histograms · Issue #16579 · prometheus/prometheus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Native histograms: unary minus and negative histograms #16579
Open
@krajorama

Description

@krajorama

From the Native histograms spec:

The unary minus can be used on native histograms. It returns a histogram where all bucket populations and the count and the sum of observations have their sign inverted. Everything else stays the same, including the counter reset hint. Note, however, that explicit counter reset detection will be thrown off by the inverted signs. (TODO: Maybe we should mark all negative histograms as gauges?) Negative histograms do not really make sense on their own and are only supposed to act as intermediate results inside other expressions.

If someone has a recording rule to record -histogram_test where histogram_test is a counter native histogram that has observations between sample, the resulting series would see a counter reset on each sample, creating a new chunk per every sample.

Some ways to deal with this:

  • do nothing
  • make the result a gauge
  • mark the chunk as negative, but store the positive values to avoid resets

Related to #16576

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0