You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened: Dashboard is set to Last 6 hours, panel is set to This month so far (now/M). The $__range variable is used in a Prometheus query. Start and end parameters are correct, however, $__range evaluates to 6h.
What you expected to happen: $__range should evaluate to the overridden range
How to reproduce it (as minimally and precisely as possible): Setup a new dashboard, add a new panel, override relative time and use $__range in the query. Then use the query inspector to view the replacement for $__range
Anything else we need to know?: Grafana is running in Docker
Data source type & version: Prometheus, Version 2.9.1
OS Grafana is installed on: Linux *** 4.15.0-47-generic constantLine() function doesn't work #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux as Docker host, Linux bef47d8138a2 4.15.0-47-generic constantLine() function doesn't work #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 GNU/Linux in Docker container
User OS & Browser: OS: Linux *** 4.15.0-48-generic PR for issue 24 #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux, Browser:
Grafana plugins:
Alert List
Azure Monitor
Carpet plot
CloudWatch
Dashboard list
Discrete
Elasticsearch
Gauge
Getting Started
Graph
Graphite
Heatmap
InfluxDB
Loki
Microsoft SQL Server
MySQL
OpenTSDB
Plugin list
PostgreSQL
Prometheus
Singlestat
Stackdriver
Sun and Moon
Table
TestData DB
Text
Others: Running in Docker (Image f96bf1723e2a)
The text was updated successfully, but these errors were encountered:
So if anyone wants to start on this, setup a prometheus data source and issue a query using $__range in a range vector. Use Query inspector to see what it get's interpolated to.
Below the queries specify a panel relative time override. This changes the panel time range
and it should affect the $__range variable.
uses timeSrv.timeRange() instead of taking in the time range as function arg (the query method gets a time range), pass the query time range to this function and use that.
…d range (#17352)
The range variables get filled with the range from the query options,
not with the range in the timeSrv object. This means that panels that
use a relative time override get the correct values from the __range
variables.
Fixes#17102
What happened: Dashboard is set to Last 6 hours, panel is set to This month so far (now/M). The
$__range
variable is used in a Prometheus query. Start and end parameters are correct, however,$__range
evaluates to 6h.What you expected to happen:
$__range
should evaluate to the overridden rangeHow to reproduce it (as minimally and precisely as possible): Setup a new dashboard, add a new panel, override relative time and use
$__range
in the query. Then use the query inspector to view the replacement for$__range
Anything else we need to know?: Grafana is running in Docker
Environment:
The text was updated successfully, but these errors were encountered: