From 2c77f2231e612e8d329a52161b41192b0e6b289c Mon Sep 17 00:00:00 2001 From: Jack Meagher Date: Thu, 14 Jul 2016 04:29:22 -0400 Subject: [PATCH] Do not substitute #[A-Z] in graphite target when invalid ref (#5581) * Do not substitute #[A-Z] in graphite target when invalid ref In the case where #[A-Z] does not reference another query, such as #J when there are only 2 queries, do not perform the substitution. This prevents the situation target name without a query labelled J (10th query). * Do not substitute #[A-Z] in graphite target when invalid ref In the case where #[A-Z] does not reference another query, such as #J when there are only 2 queries, do not perform the substitution. This prevents the situation target name without a query labelled J (10th query). --- public/app/plugins/datasource/graphite/datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/graphite/datasource.ts b/public/app/plugins/datasource/graphite/datasource.ts index efb107e3b16..84084a0609a 100644 --- a/public/app/plugins/datasource/graphite/datasource.ts +++ b/public/app/plugins/datasource/graphite/datasource.ts @@ -228,7 +228,7 @@ export function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv } function nestedSeriesRegexReplacer(match, g1) { - return targets[g1]; + return targets[g1] || match; } for (i = 0; i < options.targets.length; i++) {