prometheus: fix: use shallow clone of scopedVars (#82280)

fix: use shallow clone of scopedVars
This commit is contained in:
Darren Janeczek 2024-02-10 09:57:11 -05:00 committed by GitHub
parent f0bbfc8422
commit 02c0f5929c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { cloneDeep, defaults } from 'lodash';
import { defaults } from 'lodash';
import { lastValueFrom, Observable, throwError } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import semver from 'semver/preload';
@ -877,7 +877,7 @@ export class PrometheusDatasource
// Used when running queries through backend
applyTemplateVariables(target: PromQuery, scopedVars: ScopedVars, filters?: AdHocVariableFilter[]) {
const variables = cloneDeep(scopedVars);
const variables = { ...scopedVars };
// We want to interpolate these variables on backend.
// The pre-calculated values are replaced withe the variable strings.

View File

@ -1,4 +1,4 @@
import { cloneDeep, defaults } from 'lodash';
import { defaults } from 'lodash';
import { lastValueFrom, Observable, throwError } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import semver from 'semver/preload';
@ -877,7 +877,7 @@ export class PrometheusDatasource
// Used when running queries through backend
applyTemplateVariables(target: PromQuery, scopedVars: ScopedVars, filters?: AdHocVariableFilter[]) {
const variables = cloneDeep(scopedVars);
const variables = { ...scopedVars };
// We want to interpolate these variables on backend.
// The pre-calculated values are replaced withe the variable strings.