Get CloudWatch Metric using tag filtering

We want to show DiskQueueDepth for all DBInstances with a specific tag/value.

For instance, we want a single dashboard, which has a variable “Environment”, which would be “prod”, “staging”, “dev”, etc. We then want DiskQueueDepth, for all DB instances with tag “Environment” = ${Environment}"

How do you specify tag filtering in the Dimensions?

what would this query look like if you ran it outside of grafana let’s say in some query tool provided by cloud watch?