From ebebbddb2d3f50997199aa6e5c68a02fac4f1de7 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Tue, 17 Oct 2017 19:26:16 +0900 Subject: [PATCH] allow ":" character for metric name --- public/app/plugins/datasource/prometheus/completer.ts | 2 +- public/app/plugins/datasource/prometheus/mode-prometheus.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/completer.ts b/public/app/plugins/datasource/prometheus/completer.ts index 449a5f34b49..a8658a35922 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-Z_0-9=]/]; + identifierRegexps = [/[\[\]a-zA-Z0-9_:=]/]; constructor(private datasource: PrometheusDatasource) { this.labelQueryCache = {}; diff --git a/public/app/plugins/datasource/prometheus/mode-prometheus.js b/public/app/plugins/datasource/prometheus/mode-prometheus.js index 165c1a364c4..352bcb8dfb5 100644 --- a/public/app/plugins/datasource/prometheus/mode-prometheus.js +++ b/public/app/plugins/datasource/prometheus/mode-prometheus.js @@ -43,7 +43,7 @@ var PrometheusHighlightRules = function() { regex : "\\d+[smhdwy]" }, { token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + regex : "[a-zA-Z_:][a-zA-Z0-9_:]*" }, { token : "keyword.operator", regex : "\\+|\\-|\\*|\\/|%|\\^|=|==|!=|<=|>=|<|>|=\\~|!\\~"