Skip to content

Commit a5fd40e

Browse files
committed
OpenTSDB: Fixed issue with auto interval variable going below 1s, Fixes grafana#1325
1 parent 2c5f192 commit a5fd40e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/app/features/opentsdb/datasource.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ function (angular, _, kbn) {
2626
var end = convertToTSDBTime(options.range.to);
2727
var qs = [];
2828

29-
if (options.interval.match(/\.[0-9]+s/)) {
30-
options.interval = parseFloat(options.interval)*1000 + "ms";
31-
}
3229
_.each(options.targets, function(target) {
3330
qs.push(convertTargetToQuery(target, options.interval));
3431
});
@@ -158,8 +155,13 @@ function (angular, _, kbn) {
158155
}
159156

160157
if (!target.disableDownsampling) {
161-
var buf = target.downsampleInterval || interval;
162-
query.downsample = templateSrv.replace(buf) + "-" + target.downsampleAggregator;
158+
interval = templateSrv.replace(target.downsampleInterval || interval);
159+
160+
if (interval.match(/\.[0-9]+s/)) {
161+
interval = parseFloat(interval)*1000 + "ms";
162+
}
163+
164+
query.downsample = interval + "-" + target.downsampleAggregator;
163165
}
164166

165167
query.tags = angular.copy(target.tags);

0 commit comments

Comments
 (0)