I\'m using Grafana with Prometheus and I\'d like to build a query that depends on the selected period of time selected in the upper right corner of the screen.
Is there
If you are looking at using prometheus as data source, $__range supports your dashboard time is great.
increase(gin_total_requests[$__range])
Why create your variable when you can use inbuilt Global variable.
I have added links to documentations to back up my answer Grafan 5.3+