diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js index fbb854148f9..a6b08f1526f 100644 --- a/public/app/core/utils/kbn.js +++ b/public/app/core/utils/kbn.js @@ -119,10 +119,14 @@ function($, _) { s: 1 }; - kbn.calculateInterval = function(range, resolution, userInterval) { + kbn.calculateInterval = function(range, resolution, userInterval, lowLimit) { var lowLimitMs = 1; // 1 millisecond default low limit var intervalMs, lowLimitInterval; + if(lowLimit) { + lowLimitMs = kbn.interval_to_ms(lowLimit); + } + if (userInterval) { if (userInterval[0] === '>') { lowLimitInterval = userInterval.slice(1); diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index 98212225f25..0aa69aaf714 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -134,6 +134,12 @@
  • +
  • + Auto interval min value The calculated value will not go below this threshold +
  • +
  • + +
  • diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 6029bdf899c..aa2cb177727 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -60,7 +60,7 @@ function (angular, _, kbn) { variable.options.unshift({ text: 'auto', value: '$__auto_interval' }); } - var interval = kbn.calculateInterval(timeSrv.timeRange(), variable.auto_count); + var interval = kbn.calculateInterval(timeSrv.timeRange(), variable.auto_count, null, variable.auto_min); templateSrv.setGrafanaVariable('$__auto_interval', interval); };