Graphite: Fix splitting expressions in tag_value with template variables (#86958)

fix spilitting expressions in tag_value with template variables
This commit is contained in:
EduardZaydler 2024-06-03 21:27:14 +07:00 committed by GitHub
parent f902e16d26
commit dbec8465e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -511,7 +511,7 @@ export class GraphiteDatasource
// special handling for tag_values(<tag>[,<expression>]*), this is used for template variables
let allParams = interpolatedQuery.match(/^tag_values\((.*)\)$/);
let expressions = allParams ? allParams[1].split(',').filter((p) => !!p) : undefined;
let expressions = allParams ? allParams[1].split(/,(?![^{]*\})/).filter((p) => !!p) : undefined;
if (expressions) {
options.limit = 10000;
return this.getTagValuesAutoComplete(expressions.slice(1), expressions[0], undefined, options);