$__interval variable is always 60.000s in TimescaleDB query

Hi all,

i want to create a simple time series dashboard chart from a TimescaleDB database. For that, i use the $__interval variable:

SELECT
  $__timeGroupAlias(ref_timestamp, $__interval),  
  AVG(value)
FROM database
WHERE $__timeFilter(ref_timestamp) AND tag = 'EXAMPLE'
GROUP BY time

In the query inspector, i see:

SELECT
  time_bucket('60.000s',ref_timestamp) AS "time",  
  AVG(value)
FROM database
WHERE ref_timestamp BETWEEN '2026-02-08T10:22:15.122Z' AND '2026-02-09T10:22:15.122Z' AND tag = 'EXAMPLE'
GROUP BY time

Regardless of the time period (30 minutes, 1 hour, 1 day…), the $__interval is always translated to ‘60.000s’.

What i am do wrong ?

Thanks !

PS: i use Grafana v12.3.1

What are your query options?:

Or just create custom interval variable, where you can customize ‘auto’ option for your needs + still have option to select period explicitly, e.g.:

Hi @jangaraj

Thanks for your help.

My query option are the default one:

I try to change the Min interval field to 5s but it does not change Interval (alway computed to 1m). :frowning:

In the meanwhile i also configure a custom interval variable but only value > 1m are available in the menu:

Is there any global configuration variable at Grafana level that can limit the minimum sampling period ?

Did you configure that on the datasource level?

Nope, did not set anything:

Changing the default setting to 5s (my use case):

Do not change anything:

  • custom interval variable only display value >= 1m
  • interval variable never return value <1m

After some test (recreating data source / dashboard), the last solution works.

Request are now done with a sampling of 5 seconds when needed.

Thanks @jangaraj !

2 Likes