|
|
@@ -10,7 +10,7 @@ function (angular, _, kbn) {
|
|
|
|
|
|
var module = angular.module('grafana.services');
|
|
|
|
|
|
- module.factory('KairosDBDatasource', function($q, $http, templateSrv) {
|
|
|
+ module.factory('KairosDBDatasource', function($q, backendSrv, templateSrv) {
|
|
|
|
|
|
function KairosDBDatasource(datasource) {
|
|
|
this.type = datasource.type;
|
|
|
@@ -51,10 +51,6 @@ function (angular, _, kbn) {
|
|
|
return this.performTimeSeriesQuery(queries, start, end).then(handleKairosDBQueryResponseAlias, handleQueryError);
|
|
|
};
|
|
|
|
|
|
- ///////////////////////////////////////////////////////////////////////
|
|
|
- /// Query methods
|
|
|
- ///////////////////////////////////////////////////////////////////////
|
|
|
-
|
|
|
KairosDBDatasource.prototype.performTimeSeriesQuery = function(queries, start, end) {
|
|
|
var reqBody = {
|
|
|
metrics: queries,
|
|
|
@@ -70,7 +66,7 @@ function (angular, _, kbn) {
|
|
|
data: reqBody
|
|
|
};
|
|
|
|
|
|
- return $http(options);
|
|
|
+ return backendSrv.datasourceRequest(options);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
@@ -83,7 +79,7 @@ function (angular, _, kbn) {
|
|
|
method: 'GET'
|
|
|
};
|
|
|
|
|
|
- return $http(options).then(function(response) {
|
|
|
+ return backendSrv.datasourceRequest(options).then(function(response) {
|
|
|
if (!response.data) {
|
|
|
return $q.when([]);
|
|
|
}
|
|
|
@@ -110,7 +106,7 @@ function (angular, _, kbn) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- return $http(options).then(function(result) {
|
|
|
+ return backendSrv.datasourceRequest(options).then(function(result) {
|
|
|
if (!result.data) {
|
|
|
return $q.when([]);
|
|
|
}
|
|
|
@@ -139,7 +135,7 @@ function (angular, _, kbn) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- return $http(options).then(function(result) {
|
|
|
+ return backendSrv.datasourceRequest(options).then(function(result) {
|
|
|
if (!result.data) {
|
|
|
return $q.when([]);
|
|
|
}
|
|
|
@@ -158,7 +154,7 @@ function (angular, _, kbn) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- return $http(options).then(function(response) {
|
|
|
+ return backendSrv.datasourceRequest(options).then(function(response) {
|
|
|
if (!response.data) {
|
|
|
return [];
|
|
|
}
|