|
|
@@ -68,7 +68,7 @@ function (angular, _, kbn) {
|
|
|
}
|
|
|
else {
|
|
|
|
|
|
- var template = "select [[group]][[group_comma]] [[func]](\"[[column]]\") as \"[[column]]_[[func]]\" from \"[[series]]\" " +
|
|
|
+ var template = "select [[group]][[group_comma]] [[func]](\"[[column]]\") as \"[[column]]_[[func]]\" from [[series]] " +
|
|
|
"where [[timeFilter]] [[condition_add]] [[condition_key]] [[condition_op]] [[condition_value]] " +
|
|
|
"group by time([[interval]])[[group_comma]] [[group]] order asc";
|
|
|
|
|
|
@@ -86,6 +86,10 @@ function (angular, _, kbn) {
|
|
|
group: target.groupby_field_add ? target.groupby_field : '',
|
|
|
};
|
|
|
|
|
|
+ if(!templateData.series.match('^/.*/')) {
|
|
|
+ templateData.series = '"' + templateData.series + '"';
|
|
|
+ }
|
|
|
+
|
|
|
query = _.template(template, templateData, this.templateSettings);
|
|
|
query = filterSrv.applyTemplateToTarget(query);
|
|
|
|
|
|
@@ -112,12 +116,11 @@ function (angular, _, kbn) {
|
|
|
};
|
|
|
|
|
|
InfluxDatasource.prototype.listColumns = function(seriesName) {
|
|
|
- return this.doInfluxRequest('select * from "' + seriesName + '" limit 1').then(function(data) {
|
|
|
+ return this.doInfluxRequest('select * from /' + seriesName + '/ limit 1').then(function(data) {
|
|
|
if (!data) {
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
- return data[0].columns;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -229,7 +232,7 @@ function (angular, _, kbn) {
|
|
|
datapoints[i] = [metricValue, groupPoints[i][timeCol]];
|
|
|
}
|
|
|
|
|
|
- seriesName = alias ? alias : key;
|
|
|
+ seriesName = alias ? alias : series.name;
|
|
|
|
|
|
// if mulitple groups append key to alias
|
|
|
if (alias && groupByField) {
|