Reputation: 549
Grafana and Prometheus newb here :(.
I'm working on a Grafana Dashboard where one of the panels has the following characteristics:
Table
Table
(see image at the bottom left)What I'm trying to achieve is that the value computed for the column Value reacts to the global time range selected at the dashboard level (image top right in red). At the moment, if I change the global time range for the dashboard, that is not reflected in the table panel time series values.
So far, I can only control this (the time range in which the query is applied) by changing the range selector in the query itself (image bottom center in green arrow). E.g. if I change [2m]
for [24h]
, the Value column results are as expected.
I've looked into the Grafana docs for some variable/macro containing the selected time range in the dashboard (something like $__timeFilter
for MySQL Data Source), but no luck so far. Perhaps a different query might yield the expected result.
The rest of the panels in the Dashboard respond properly to this global time range changes. Those panels have the following characteristics:
Graph
Time series
Anything I might be missing here? Does Grafana support what I'm trying to do?
Additional details:
Upvotes: 0
Views: 2247
Reputation: 549
Digging deeper, we can find that there's a global built-in variable that can be used in queries named $__range
. See the Using interval and range variables subsection in the Grafana Prometheus Data source docs for more details.
By simply using $__range
in the query, we can react to the Grafana dashboard global time range filter. The resulting query would be:
sum(delta(indexed_event{app="APP_SELECTOR"}[$__range])) by (event_name)
Upvotes: 0