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

Support dashboard time range macros in variables #224

Closed
LukeDefeo opened this issue Mar 23, 2020 · 5 comments
Closed

Support dashboard time range macros in variables #224

LukeDefeo opened this issue Mar 23, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@LukeDefeo
Copy link

Feature Request

Is your feature request related to a problem? Please describe.
We use variables to give the user dropdowns, currently we have to hard code the timerange in the variable to some fixed amount, when the user changes the grafana time range the drop down doesnt correspond the correct data for whats in the charts and is confusing

Describe the solution you'd like
Support the macros related to timeFiltering in variable queries e.g $__timeFilter $__timeFrom $__timeTo

@avivl avivl added the enhancement New feature or request label Mar 23, 2020
@avivl
Copy link
Contributor

avivl commented Mar 23, 2020

@LukeDefeo are you aware of any data source that supports this?

@LukeDefeo
Copy link
Author

The variables have an option to refresh on time range change so i assume some support it.

Anyway i just discovered in the docs that the variables $__from and $__to are always available to i was able to achieve my goal using them.

@LukeDefeo
Copy link
Author

SELECT DISTINCT x FROM `table` WHERE pt between TIMESTAMP_MILLIS($__from) and TIMESTAMP_MILLIS($__to)

Ill just leave this here if anyone else needs an example

@avivl
Copy link
Contributor

avivl commented Mar 23, 2020

@LukeDefeo Thank you!

@avivl
Copy link
Contributor

avivl commented Apr 6, 2020

@LukeDefeo I'll stop maintaining this data source in a couple of weeks.
@Tamirklein and his team will take over.
I would also like to thank you for your involvement and contribution to this project

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

No branches or pull requests

2 participants