[v9.4.x] Loki ds: Interpolation breaks in Loki queries when no scoped vars (#63700)

Loki ds: Interpolation breaks in Loki queries when no scoped vars (#63694)

(cherry picked from commit 14e29451cf)

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2023-02-24 10:28:34 +01:00
committed by GitHub
co-authored by Ivan Ortega Alba
parent 30f3f63bd6
commit a3b692e1c5
@@ -972,7 +972,7 @@ export class LokiDatasource
// Used when running queries through backend
applyTemplateVariables(target: LokiQuery, scopedVars: ScopedVars): LokiQuery {
// We want to interpolate these variables on backend
const { __interval, __interval_ms, ...rest } = scopedVars;
const { __interval, __interval_ms, ...rest } = scopedVars || {};
const exprWithAdHoc = this.addAdHocFilters(target.expr);