Просмотр исходного кода

prometheus: fix variable query to fallback correctly to series query

Using a query of for example up or up{job=job1}
Marcus Efraimsson 7 лет назад
Родитель
Сommit
6687409efb

+ 4 - 0
public/app/plugins/datasource/prometheus/datasource.ts

@@ -329,4 +329,8 @@ export class PrometheusDatasource {
     }
     return Math.ceil(date.valueOf() / 1000);
   }
+
+  getOriginalMetricName(labelData) {
+    return this.resultTransformer.getOriginalMetricName(labelData);
+  }
 }

+ 1 - 1
public/app/plugins/datasource/prometheus/metric_find_query.ts

@@ -121,7 +121,7 @@ export default class PrometheusMetricFindQuery {
 
     var self = this;
     return this.datasource.metadataRequest(url).then(function(result) {
-      return _.map(result.data.data, function(metric) {
+      return _.map(result.data.data, metric => {
         return {
           text: self.datasource.getOriginalMetricName(metric),
           expandable: true,