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

This commit is contained in:
Ivan Ortega Alba 2023-02-24 09:18:08 +01:00 committed by GitHub
parent 6cee0cdbad
commit 14e29451cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -981,7 +981,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);