mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
InfluxDB: Flux: make $__interval and $__interval_ms work in alerting (#38889)
* influxdb: flux: handle $__interval and $__interval_ms in alert-queries * influxdb: flux: do not handle interval-variable in the frontend * $__interval should be rounded * added comment
This commit is contained in:
@@ -188,9 +188,12 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
|
||||
throw new Error('applyTemplateVariables called in influxql-mode. this should never happen');
|
||||
}
|
||||
|
||||
// We want to interpolate these variables on backend
|
||||
const { __interval, __interval_ms, ...rest } = scopedVars;
|
||||
|
||||
return {
|
||||
...query,
|
||||
query: this.templateSrv.replace(query.query ?? '', scopedVars), // The raw query text
|
||||
query: this.templateSrv.replace(query.query ?? '', rest), // The raw query text
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user