Преглед изворни кода

allow ":" character for metric name

Mitsuhiro Tanda пре 8 година
родитељ
комит
ebebbddb2d

+ 1 - 1
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 = {};

+ 1 - 1
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 : "\\+|\\-|\\*|\\/|%|\\^|=|==|!=|<=|>=|<|>|=\\~|!\\~"