|
@@ -8,7 +8,7 @@ function (angular, _, kbn) {
|
|
|
|
|
|
|
|
var module = angular.module('kibana.services');
|
|
var module = angular.module('kibana.services');
|
|
|
|
|
|
|
|
- module.factory('InfluxDatasource', function($q, $http) {
|
|
|
|
|
|
|
+ module.factory('InfluxDatasource', function($q, $http, filterSrv) {
|
|
|
|
|
|
|
|
function InfluxDatasource(datasource) {
|
|
function InfluxDatasource(datasource) {
|
|
|
this.type = 'influxDB';
|
|
this.type = 'influxDB';
|
|
@@ -110,6 +110,26 @@ function (angular, _, kbn) {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ InfluxDatasource.prototype.metricFindQuery = function (query) {
|
|
|
|
|
+ var interpolated;
|
|
|
|
|
+ try {
|
|
|
|
|
+ interpolated = filterSrv.applyFilterToTarget(query);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(err) {
|
|
|
|
|
+ return $q.reject(err);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return this.doInfluxRequest(query, 'filters')
|
|
|
|
|
+ .then(function (results) {
|
|
|
|
|
+ return _.map(results[0].points, function (metric) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ text: metric[1],
|
|
|
|
|
+ expandable: false
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
function retry(deferred, callback, delay) {
|
|
function retry(deferred, callback, delay) {
|
|
|
return callback().then(undefined, function(reason) {
|
|
return callback().then(undefined, function(reason) {
|
|
|
if (reason.status !== 0) {
|
|
if (reason.status !== 0) {
|