Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Respect $range in variable evaluation requests #26

Merged
merged 3 commits into from Oct 10, 2019
Merged

Respect $range in variable evaluation requests #26

merged 3 commits into from Oct 10, 2019

Conversation

zarbis
Copy link
Contributor

@zarbis zarbis commented Jan 28, 2019

Unlike InfluxQL, Flux allows extracting tag values for specific time range. Right now it's impossible to utilize this feature in Grafana since $range in request like this:

from(bucket: "analytics")
|> range($range)
|> filter(fn: (r) =>  r._measurement == "foo" )
|> keyValues(keyColumns: ["bar"])

is always expanded into hard-coded start: -1h.

It leads to confusing and hard-to-pinpoint inconsistencies. For example:

  1. you have table with daily summary of events by their type
  2. time picker is set to Last 7 days
  3. but sums of events are calculated only on types of events that happened only in last hour

This happens due to event types are retrieved from Grafana variable, populated by Flux query. This PR makes Grafana to template correct time range into variable query.

@zarbis
Copy link
Contributor Author

zarbis commented Mar 7, 2019

@davkal PTAL

@jtlisi
Copy link
Contributor

jtlisi commented Mar 13, 2019

LGTM, I will test this tomorrow and try to get it merged.

@zarbis
Copy link
Contributor Author

zarbis commented Mar 19, 2019

@jtlisi any progress on this?

@zarbis
Copy link
Contributor Author

zarbis commented Apr 18, 2019

@jtlisi humble bump

@zarbis
Copy link
Contributor Author

zarbis commented Jun 6, 2019

Anyone?

@zarbis
Copy link
Contributor Author

zarbis commented Jul 11, 2019

@davkal PTAL

@zarbis
Copy link
Contributor Author

zarbis commented Jul 24, 2019

@jtlisi Still working on this?

@davkal
Copy link
Collaborator

davkal commented Jul 24, 2019

I think we need @briangann

@andig
Copy link

andig commented Aug 5, 2019

Lgtm. What is missing to get this merged?

/cc @daniellee

@zarbis
Copy link
Contributor Author

zarbis commented Sep 10, 2019

@daniellee any chance for it to get merged within this year? :)

@ryantxu
Copy link
Member

ryantxu commented Sep 19, 2019

@zarbis -- I am going to try to release this in ~1 week. If there is anything else you are looking at I will have to time to focus on it next week

@zarbis
Copy link
Contributor Author

zarbis commented Oct 4, 2019

@ryantxu any progress on this?

@srclosson srclosson merged commit 6027c93 into grafana:master Oct 10, 2019
@zarbis zarbis deleted the variables-time-range branch October 10, 2019 19:54
@srclosson
Copy link
Member

Merged into master. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants