0

I'm making dashboard and as a reference I'm using already existing one, that dashboard has $interval variable which has such a settings . and it used for example in the pane title, like this Top routes for [$interval], and in actual dashboard it replacing $interval variable in title depends on selected range.

So in my dashboard I made identical variable, and add it also to pane title, but for some reason it's not dynamic for me at all, it always showing 1 minute...

Also here is a comparison of JSON parts of dashboard related to that variable. Referenced dashboard:

{
        "auto": true,
        "auto_count": 1,
        "auto_min": "5m",
        "current": {
          "selected": false,
          "text": "auto",
          "value": "$__auto_interval_interval"
        },
        "description": null,
        "error": null,
        "hide": 2,
        "label": "interval",
        "name": "interval",
        "options": [
          {
            "selected": true,
            "text": "auto",
            "value": "$__auto_interval_interval"
          },
          {
            "selected": false,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "12h",
            "value": "12h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "7d",
            "value": "7d"
          },
          {
            "selected": false,
            "text": "14d",
            "value": "14d"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          }
        ],
        "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      },

and here is mine:

{
        "auto": true,
        "auto_count": 1,
        "auto_min": "5m",
        "current": {
          "selected": false,
          "text": "1m",
          "value": "1m"
        },
        "description": null,
        "error": null,
        "hide": 2,
        "label": "interval",
        "name": "interval",
        "options": [
          {
            "selected": false,
            "text": "auto",
            "value": "$__auto_interval_interval"
          },
          {
            "selected": true,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "10m",
            "value": "10m"
          },
          {
            "selected": false,
            "text": "30m",
            "value": "30m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "12h",
            "value": "12h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          },
          {
            "selected": false,
            "text": "7d",
            "value": "7d"
          },
          {
            "selected": false,
            "text": "14d",
            "value": "14d"
          },
          {
            "selected": false,
            "text": "30d",
            "value": "30d"
          }
        ],
        "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      }

So depends on json in selected section in both cases we have selected:false, but for some reason in my dashboard 1m is default but should be auto.

What I'm doing wrong, am I miss something. Thank you!

Bogdan Dubyk
  • 4,756
  • 7
  • 30
  • 67

1 Answers1

1

Your variable is hidden, so you don't see what is selected. This config:

        "current": {
          "selected": false,
          "text": "1m",
          "value": "1m"
        },

defines that default value is 1m.

You need to have auto value as default value:

        "current": {
          "selected": false,
          "text": "auto",
          "value": "$__auto_interval_interval"
        },

then auto will be default value (unless you will specify variable value explicitly in the URL as parameter)

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • well, yeah, it make sense and I can see it, but as I mentioned already variables configurations identical, and in both "auto option" toggle is ON. So I do not understand why it's not working on my dashboard... Also I do not see any additional (hardcoded) interval parameters in url, both URLs for mine and that other dashboard are the same – Bogdan Dubyk Oct 25 '21 at 06:31
  • @BogdanDubyk no, config is the same, but not selected value. Please unhide variables in your dashboards, so you will see their values. `auto` != `1m`. How do you want to debug it when you hide it? – Jan Garaj Oct 25 '21 at 06:51
  • okay, how to not hide them??? Sorry, I'm not sure I following – Bogdan Dubyk Oct 25 '21 at 06:56
  • oh, okay, looks like I made it. In the variable configuration in `Hide` dropdown I had `Value` selected, I change it to `Label` and afterwords it showed me dropdown where I selected `Auto`. – Bogdan Dubyk Oct 25 '21 at 07:00