mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Replace pre-calculated $__interval values for backend interpolation (#79697)
Loki datasource: pass through interval variables
This commit is contained in:
parent
0424d44b39
commit
b312f48c10
@ -1085,10 +1085,21 @@ export class LokiDatasource
|
|||||||
|
|
||||||
const exprWithAdHoc = this.addAdHocFilters(target.expr, adhocFilters);
|
const exprWithAdHoc = this.addAdHocFilters(target.expr, adhocFilters);
|
||||||
|
|
||||||
|
const variables = {
|
||||||
|
...rest,
|
||||||
|
|
||||||
|
// pass through for backend interpolation. Need to be in scopedVars for Scenes though
|
||||||
|
__interval: {
|
||||||
|
value: '$__interval',
|
||||||
|
},
|
||||||
|
__interval_ms: {
|
||||||
|
value: '$__interval_ms',
|
||||||
|
},
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
...target,
|
...target,
|
||||||
legendFormat: this.templateSrv.replace(target.legendFormat, rest),
|
legendFormat: this.templateSrv.replace(target.legendFormat, rest),
|
||||||
expr: this.templateSrv.replace(exprWithAdHoc, rest, this.interpolateQueryExpr),
|
expr: this.templateSrv.replace(exprWithAdHoc, variables, this.interpolateQueryExpr),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user