Enable the Include All option for a template variable automatically makes that the default value. This can make things unusable for some dashboards since too expensive to load. Saving the template values with the dashboard is an ok workaround, but still a bit klunky in that we have to select arbitrary values that may confuse future visitors. Plus, it breaks down when the variable is populated by a templated data source: changing the data source resets the dependent variables back to All which causes the browser to catch fire.
Has anyone found a more elegant workaround? Thanks!
I had the same issue. I have quite a hacky solution
In the grafana.dark..css and grafana.light..css files insert a line all at the beginning
@import utl('custom.css');
in the same folder as the grafana.dark/light css files, create a file named ācustom.cssā (without quotes of course) In that file, enter these css rules
a[aria-label="Dashboard template variables Variable Value DropDown value link text All"] span::after,
span[aria-label="Dashboard template variables Variable Value DropDown option text All"]::after {
content: "None";
visibility: visible;
Margin-left: -16px;
}
a[aria-label="Dashboard template variables Variable Value DropDown value link text All"] span,
span[aria-label="Dashboard template variables Variable Value DropDown option text All"] {
visibility: hidden;
}
Now in the variable of the dashboard, switch on the include all option, and set the custom all value to āā (two single quotes without any space) ⦠click update and save the dashboard.
I tested this on Grafana 7.1.1 and 8.0.6 and at my installation it shows āNoneā instead of āAllā: and my query shows " point IN(āā) " when None is selected. I am using only the mssql datasources, but this may work with other datasources as well.
NOTE: this is a hacky solution and you need to modify the default css file(s). This may also break when the html structure is updated, or another build is installed (then the css files need modification again)
Another alternative is to make grafana spit out the selected values separated by pipes: ... environment=~"${env:pipe}" ...
Doesnāt solve the ānothing selectedā situation though
Many thanks @barts2108
FYI if running Grafana in a Docker container, the path within the container to the grafana*.css files exists at something that looks like this (I am guessing it will not be the same exact path in all container instances):