diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js
index b9593c013a1..d7cc354861f 100644
--- a/public/app/plugins/datasource/opentsdb/datasource.js
+++ b/public/app/plugins/datasource/opentsdb/datasource.js
@@ -272,6 +272,10 @@ function (angular, _, dateMath) {
}
query.downsample = interval + "-" + target.downsampleAggregator;
+
+ if (target.downsampleFillPolicy !== "none") {
+ query.downsample += "-" + target.downsampleFillPolicy;
+ }
}
query.tags = angular.copy(target.tags);
diff --git a/public/app/plugins/datasource/opentsdb/partials/query.editor.html b/public/app/plugins/datasource/opentsdb/partials/query.editor.html
index 8a3c0c0f753..fffa7194228 100644
--- a/public/app/plugins/datasource/opentsdb/partials/query.editor.html
+++ b/public/app/plugins/datasource/opentsdb/partials/query.editor.html
@@ -104,8 +104,20 @@
-
- Disable downsampling
+
+ Fill policy
+ Available since OpenTSDB 2.2
+
+
+
+
+
+
+
+ Disable downsampling
diff --git a/public/app/plugins/datasource/opentsdb/queryCtrl.js b/public/app/plugins/datasource/opentsdb/queryCtrl.js
index 8af3af206b6..14d28c310c2 100644
--- a/public/app/plugins/datasource/opentsdb/queryCtrl.js
+++ b/public/app/plugins/datasource/opentsdb/queryCtrl.js
@@ -13,6 +13,7 @@ function (angular, _, kbn) {
$scope.init = function() {
$scope.target.errors = validateTarget($scope.target);
$scope.aggregators = ['avg', 'sum', 'min', 'max', 'dev', 'zimsum', 'mimmin', 'mimmax'];
+ $scope.fillPolicies = ['none', 'nan', 'null', 'zero'];
if (!$scope.target.aggregator) {
$scope.target.aggregator = 'sum';
@@ -22,6 +23,10 @@ function (angular, _, kbn) {
$scope.target.downsampleAggregator = 'avg';
}
+ if (!$scope.target.downsampleFillPolicy) {
+ $scope.target.downsampleFillPolicy = 'none';
+ }
+
$scope.datasource.getAggregators().then(function(aggs) {
$scope.aggregators = aggs;
});