You can use variables in the Scalyr Grafana integration. These are useful because they will allow you to create more interactive and dynamic dashboards. Instead of hard-coding things like path, cluster, and datacenter names in your metric queries, you can utilize template parameters. Variables are displayed as dropdown lists at the top of the dashboard and the graph setup page.
Instructions
1. Create a dashboard - Start in Grafana by clicking the "+" and selecting "Dashboard"
2. Create a new Viz - Select "Add Query" to start
3. Open Dashboard settings - Once you create the first query, setup params by going into settings
2. Select the Variables Tab
3. Add Variable
4. Configure Param - Name your variable, set "Type" to "Custom", add your values, and select options. Press "Add" then "Save"
5. Reference your variables. Add 1 or many queries in multiple graphs. [[variable]] is the recommended syntax
For general information on Grafana variables see the Grafana documentation
Queries support all Grafana variable substitution syntaxes, for example:
$varname
[[varname]]
${varname:option}
For multi-value variables there is a custom default substitution method, the values will be quoted and separated with commas, for example:
"value1","value2","value3"
The expected use of multi-value variables is for in
queries, for example:
$serverHost=($host)
6. Go back to the "Dashboard" and select your params
Comments
0 comments
Please sign in to leave a comment.