Skip to content

Returned by a data source time series is not filtered by time window #132

Open
@vanchaxy

Description

@vanchaxy

What happened?

If the data source returns time series outside of the specified window they are still used in the reduce function.

For example, on the screenshot, you can see that all data points in the last 5 minutes are 0 but reduced to max returns 1.

image

Currently, I have this issue with the forked sentry data source because Sentry ignores a specified time window but this could be with any other data source with a similar problem.

What did you expect to happen?

I expect Grafana to use only data points from the selected time window. This is especially confusing because when specifying an alert via provisioning relativeTimeRange is specified under in reduce query but it's completely ignored. E.g.

      - refId: B
        datasourceUid: "__expr__"
        model:
          refId: B
          type: reduce
          datasource:
            uid: "-100"
            type: __expr__
          expression: A
          reducer: max
          relativeTimeRange: # doesn't matter, all range from A is using
            from: 900
            to: 0

Did this work before?

No idea, I noticed it only now

How do we reproduce it?

  1. Use a data source that returns time series outside selected window
  2. Use any min/max reduce function

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 10.1.2

Grafana platform?

Kubernetes

Datasource(s)?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions