Skip to content

Propagate label selectors across binary ops #8053

@gouthamve

Description

@gouthamve

See https://utcc.utoronto.ca/~cks/space/blog/sysadmin/PrometheusLabelNonOptimization for a good explanation. Summarising:

When we select node_filesystem_files{ host="$host", mountpoint="/" } - node_filesystem_files_free, we load all the series for node_filesystem_files_free when we could simply select a subset node_filesystem_files_free{ host="$host", mountpoint="/" }. This would have significant performance impact.

See also cortexproject/cortex#3253

I am not sure if this would require a query planner, but I can see us doing some pre-processing that rewrites the PromQL to do this. VictoriaMetrics is doing this: VictoriaMetrics/VictoriaMetrics@e9f2e2c

I am just curious what the implications around correctness would be.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions