Browse Source

fix(prometheus) when tag value duplicate, tags not working. (#8040)

Kakuya Ando 8 years ago
parent
commit
bbfdfc012f
1 changed files with 6 additions and 2 deletions
  1. 6 2
      public/app/plugins/datasource/prometheus/metric_find_query.js

+ 6 - 2
public/app/plugins/datasource/prometheus/metric_find_query.js

@@ -59,9 +59,13 @@ function (_) {
 
 
       return this.datasource._request('GET', url)
       return this.datasource._request('GET', url)
       .then(function(result) {
       .then(function(result) {
-        return _.map(result.data.data, function(metric) {
+        var _labels = _.map(result.data.data, function(metric) {
+          return metric[label];
+        });
+
+        return _.uniq(_labels).map(function(metric) {
           return {
           return {
-            text: metric[label],
+            text: metric,
             expandable: true
             expandable: true
           };
           };
         });
         });