mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(influxdb): influxdb data source did not use right http abstraction for metric queries, fixes #2919
This commit is contained in:
@@ -4,10 +4,6 @@ global:
|
|||||||
evaluation_interval: 10s # By default, scrape targets every 15 seconds.
|
evaluation_interval: 10s # By default, scrape targets every 15 seconds.
|
||||||
# scrape_timeout is set to the global default (10s).
|
# scrape_timeout is set to the global default (10s).
|
||||||
|
|
||||||
# Attach these extra labels to all timeseries collected by this Prometheus instance.
|
|
||||||
labels:
|
|
||||||
monitor: 'codelab-monitor'
|
|
||||||
|
|
||||||
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
|
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
|
||||||
rule_files:
|
rule_files:
|
||||||
# - "first.rules"
|
# - "first.rules"
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ func (scanner *PluginScanner) loadPluginJson(path string) error {
|
|||||||
if !exists {
|
if !exists {
|
||||||
return errors.New("Did not find type property in plugin.json")
|
return errors.New("Did not find type property in plugin.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
DataSources[datasourceType.(string)] = pluginJson
|
DataSources[datasourceType.(string)] = pluginJson
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function (angular, _, dateMath, InfluxSeries, InfluxQueryBuilder) {
|
|||||||
|
|
||||||
var module = angular.module('grafana.services');
|
var module = angular.module('grafana.services');
|
||||||
|
|
||||||
module.factory('InfluxDatasource', function($q, $http, templateSrv) {
|
module.factory('InfluxDatasource', function($q, backendSrv, templateSrv) {
|
||||||
|
|
||||||
function InfluxDatasource(datasource) {
|
function InfluxDatasource(datasource) {
|
||||||
this.type = 'influxdb';
|
this.type = 'influxdb';
|
||||||
@@ -161,7 +161,7 @@ function (angular, _, dateMath, InfluxSeries, InfluxQueryBuilder) {
|
|||||||
options.headers.Authorization = self.basicAuth;
|
options.headers.Authorization = self.basicAuth;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $http(options).then(function(result) {
|
return backendSrv.datasourceRequest(options).then(function(result) {
|
||||||
return result.data;
|
return result.data;
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err.status !== 0 || err.status >= 300) {
|
if (err.status !== 0 || err.status >= 300) {
|
||||||
|
|||||||
Reference in New Issue
Block a user