Skip to content

Aggregations that take a numeric parameter only use value from first time step in range query #15971

@charleskorn

Description

@charleskorn

What did you do?

I ran topk(scalar(param), some_series) as a range query over many time steps.

param selects a single series with different values at each time step: first 1, then 2, then 3 etc.

some_series selects many series.

What did you expect to see?

I expected to receive one value at the first time step, then two at the second step, three at the third step etc.

What did you see instead? Under which circumstances?

I received only one value at all time steps.

If I run the query as an instant query at each of the time steps in the range, I get the expected behaviour above.

Looking at the code for this, I believe a similar issue applies to all aggregations that take a scalar parameter: topk, bottomk, quantile, limitk and limit_ratio.

System information

No response

Prometheus version

Prometheus at commit 0a19f1268e2dbb9bae9568f007a9809e8fba0402

Prometheus configuration file

n/a

Alertmanager version

n/a

Alertmanager configuration file

n/a

Logs

n/a

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions