Skip to content

PromQL: topk over cross-series aggregation (e.g. sum by) is unsupported #23

Description

@milindsrivastava1997

Summary

topk applied to the output of a cross-series aggregation operator (e.g. sum by (...)) fails with an unsupported feature error. This is a valid and common PromQL pattern.

Reproduction

# P5 — topk over sum-by aggregation
topk(5, sum by (service) (http_requests_total))

Error:

ERR: unsupported feature: aggregate argument: Discriminant(0)

Expected

Should lower to Limit { Sort { Aggregate(Sum, by:[service]) { Scan } } } — the topk becomes a Sort+Limit over the inner aggregation result.

Reproduce via example

cargo run -p asap-control-lower --example topk_ir

Labels: P5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions