From 8a43d4e25c8f6b3bf35914cb6bebec678ab59e52 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Tue, 17 Oct 2017 21:26:51 +0900 Subject: [PATCH] fix vector range --- public/app/plugins/datasource/prometheus/completer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/completer.ts b/public/app/plugins/datasource/prometheus/completer.ts index a8658a35922..0d018cb028d 100644 --- a/public/app/plugins/datasource/prometheus/completer.ts +++ b/public/app/plugins/datasource/prometheus/completer.ts @@ -8,7 +8,7 @@ export class PromCompleter { labelNameCache: any; labelValueCache: any; - identifierRegexps = [/[\[\]a-zA-Z0-9_:=]/]; + identifierRegexps = [/\[/, /[a-zA-Z0-9_:]/]; constructor(private datasource: PrometheusDatasource) { this.labelQueryCache = {}; @@ -73,7 +73,7 @@ export class PromCompleter { }); } - if (prefix === '[') { + if (token.type === 'paren.lparen' && token.value === '[') { var vectors = []; for (let unit of ['s', 'm', 'h']) { for (let value of [1,5,10,30]) {