Using template variables in CloudWatch queries
Instead of hard-coding server, application, and sensor names in your metric queries, you can use variables. The variables are listed as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the display of data in your dashboard.
For an introduction to templating and template variables, refer to the Templating documentation.
You can use the following CloudWatch data source queries to specify the
Query Type field in the Variable edit view. Use them to fill a variables options list with values like
metric names, and
Read more about the available dimensions in the CloudWatch Metrics and Dimensions Reference.
||Returns a list of all AWS regions|
||Returns a list of all the namespaces CloudWatch supports.|
||Returns a list of metrics in the namespace. (specify region or use “default” for custom metrics)|
||Returns a list of dimension keys in the namespace.|
||Returns a list of dimension values matching the specified
||Returns a list of volume ids matching the specified
||Returns a list of attributes matching the specified
||Returns a list of ARNs matching the specified
||Returns a list of all the standard statistics.|
For details about the metrics CloudWatch provides, please refer to the CloudWatch documentation.
Using variables in queries
Variables can be used in the variable form. Refer to the variable syntax documentation.
ec2_instance_attribute query takes in
filters as a filter name and a comma-separated list of values.
You can specify pre-defined filters of ec2:DescribeInstances.
Only 1 attribute per instance can be returned. Any flat attribute can be selected (i.e. if the attribute has a single value and isn’t an object or array). Below is a list of available flat attributes:
You can select tags by prepending the tag name with
Tags.. For example, the tag
Name is selected with
Related Grafana resources
Unify your data with Grafana plugins: Splunk, MongoDB, Datadog, and more
Show how Grafana can be used to take data from multiple different sources and unify it, without disrupting the investments that are working today.
Getting started with Grafana Enterprise and observability
Join the Grafana Labs team for a 30-minute demo of how to get started with the Grafana Stack, so you can go from zero to observability in just a few minutes.