From 0a87618733d74bca5be8c9f2958422221fc33eea Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Mon, 25 Mar 2013 16:15:54 +0100 Subject: [PATCH] Add autocompletion for metrics. --- web/static/js/graph.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/static/js/graph.js b/web/static/js/graph.js index 5b410ce40..799bc1c9b 100644 --- a/web/static/js/graph.js +++ b/web/static/js/graph.js @@ -125,9 +125,12 @@ Prometheus.Graph.prototype.populateInsertableMetrics = function() { url: "/api/metrics", dataType: "json", success: function(json, textStatus) { + var availableMetrics = [] for (var i = 0; i < json.length; i++) { self.insertMetric[0].options.add(new Option(json[i], json[i])); + availableMetrics.push(json[i]) } + self.expr.autocomplete({source: availableMetrics}) }, error: function() { alert("Error loading available metrics!");