Skip to content

@ modifier is not properly handled by the query-frontend #4463

@cyriltovena

Description

@cyriltovena

Describe the bug

The query-frontend component currently can split query_ranges by time. (1d)
This allows to parallelize and runs queries faster, however with the recent addition of the @ modifier, splitting queries by times can create incorrect queries specially with the uses of the start() and end(), each sub queries will evaluate it's own start and end modifier.

To Reproduce

Steps to reproduce the behavior:
Run a queries that uses the @ modifier with the start/end() syntax.

http_requests_total @ start()
rate(http_requests_total[5m] @ end())

The result is incorrect compare to Prometheus.

Expected behavior

The frontend should spot those queries before splitting by time and rewrite them using constant value of @ modifier timestamp. @codesome Suggested this solution.

Storage Engine

  • Blocks
  • Chunks

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