How do I exclude certain tags from a graph or monitor?

When graphing a metric or setting up a metric monitor, it can be useful to exclude certain tags.

Exclude tags from a graph

To exclude a certain set of tags (or "scope") from a graph, go to the JSON tab in the graph editor. In the set of curly braces around the scope of the graph, add in the scope you want to exclude, proceeded by a "!".

For example, to graph the `aws.ec2.cpuutilization` metric for all your EC2 instances by availability zone, but exclude instances in one particular availability zone, edit the query to:

`avg:aws.ec2.cpuutilization{*,!availability-zone:us-east-1a} by {availability-zone}`

You can continue to chain included and excluded scopes, separated by commas.

See gif below for an example of this

Exclude tags from a monitor

To exclude a scope from a monitor, you can just type the scope you want excluded in the "excluding" field in the monitor editor:

You can also use the same "!" symbol before a scope to exclude it when editing the query in the Source tab.

Have more questions? Submit a request


Please sign in to leave a comment.