Add support for $__interval
Problem to solve
Grafana contains a special variable called $__interval
. This variable allows for each query to contain it's own time interval independent of the one set by the time selection dropdown
Intended users
User experience goal
Proposal
In grafana each chart definition contains a target section that looks like this
{
"expr": "query[$__interval]",
"interval": "1m",
...
}
In our metrics dashboard definition we might want to use a similar property as a top level definition for each chart, for example:
- title: Web
metrics:
- id: web
label: label
query_range: >- query[$__interval]
unit: "%"
type: area-chart
$__interval: 2m
One thing to note, is that each $interval variable is independent from each other, also the value of this variable shouldn't be rendered like the other variables provided by the YAML file.