From 97f54ac3853b7567da0d0786ff6c70be2a0f5c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 30 Jun 2015 12:27:42 +0200 Subject: [PATCH] Small fix to PR 2119 --- public/app/plugins/datasource/opentsdb/datasource.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js index 57559cc6687..d244b56436e 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.js +++ b/public/app/plugins/datasource/opentsdb/datasource.js @@ -91,11 +91,10 @@ function (angular, _, kbn) { }; OpenTSDBDatasource.prototype.performMetricKeyValueLookup = function(metric, key) { - if(metric === "") { - throw "Metric not set."; - } else if(key === "") { - throw "Key not set."; + if(!metric || !key) { + return $q.when([]); } + var m = metric + "{" + key + "=*}"; var options = { method: 'GET', @@ -104,6 +103,7 @@ function (angular, _, kbn) { m: m, } }; + return backendSrv.datasourceRequest(options).then(function(result) { result = result.data.results; var tagvs = [];