mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Replace pre-calculated $__interval values for backend interpolation (#79645)
This commit is contained in:
parent
110a41b3db
commit
ecb5d94b2d
@ -883,9 +883,14 @@ export class PrometheusDatasource
|
||||
applyTemplateVariables(target: PromQuery, scopedVars: ScopedVars, filters?: AdHocVariableFilter[]) {
|
||||
const variables = cloneDeep(scopedVars);
|
||||
|
||||
// We want to interpolate these variables on backend
|
||||
delete variables.__interval;
|
||||
delete variables.__interval_ms;
|
||||
// We want to interpolate these variables on backend.
|
||||
// The pre-calculated values are replaced withe the variable strings.
|
||||
variables.__interval = {
|
||||
value: '$__interval',
|
||||
};
|
||||
variables.__interval_ms = {
|
||||
value: '$__interval_ms',
|
||||
};
|
||||
|
||||
// interpolate expression
|
||||
const expr = this.templateSrv.replace(target.expr, variables, this.interpolateQueryExpr);
|
||||
|
Loading…
Reference in New Issue
Block a user