mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: make $__range more precise (#21722)
* Make $__range more precise in Prometheus
It is now always equivalent to `${__range_s}s`, rather than rounding
down to an integer multiple of the biggest possible unit. For example,
a range of 47 hours is now represented as `169200s` rather than `1d`.
Closes #21689.
* Update a unit test to match new __range calc
This commit is contained in:
@@ -111,7 +111,7 @@ Query: query_result(topk(5, sum(rate(http_requests_total[$__range])) by (instanc
|
||||
Regex: /"([^"]+)"/
|
||||
```
|
||||
|
||||
Populate a variable with the instances having a certain state over the time range shown in the dashboard, using the more precise `$__range_s`:
|
||||
Populate a variable with the instances having a certain state over the time range shown in the dashboard, using `$__range_s`:
|
||||
|
||||
```
|
||||
Query: query_result(max_over_time(<metric>[${__range_s}s]) != <state>)
|
||||
|
||||
Reference in New Issue
Block a user