Add an interval variable
- Navigate to the dashboard you want to make a variable for and then click the Dashboard settings (gear) icon at the top of the page.
- On the Variables tab, click New.
- In the Type list, select Interval.
- (optional) In Label, enter the display name of the variable dropdown. If you don’t enter a display name, then the dropdown label will be the variable name.
- Choose a Hide option:
- No selection (blank) - The variable dropdown displays the variable Name or Label value. This is the default.
- Label - The variable dropdown only displays the selected variable value and a down arrow.
- In the Values field, enter the time range intervals that you want to appear in the variable drop-down list. The following time units are supported:
s (seconds)
,m (minutes)
, ,d (days)
,w (weeks)
,M (months)
, andy (years)
. You can also accept or edit the default values: . - (optional) Turn on the Auto Option if you want to add the
auto
option to the list. This option allows you to specify how many times the current time range should be divided to calculate the currentauto
time span. If you turn it on, then two more options appear:- Step count - Select the number of times the current time range will be divided to calculate the value, similar to the Max data points query option. For example, if the current visible time range is 30 minutes, then the
auto
interval groups the data into 30 one-minute increments. The default value is 30 steps. - Min Interval - The minimum threshold below which the step count intervals will not divide the time. To continue the 30 minute example, if the minimum interval is set to 2m, then Grafana would group the data into 15 two-minute increments.
- Step count - Select the number of times the current time range will be divided to calculate the value, similar to the Max data points query option. For example, if the current visible time range is 30 minutes, then the
- In Preview of values, Grafana displays a list of the current variable values. Review them to ensure they match what you expect.