Hi,
I’m trying to configure Grafana and Cloudwatch to monitor some instances we have in AWS EC2. I’m keen to get the dashboard as effective as possible, so would like to have a couple of template variables that allow me to select server(s) by name. I’ve seen various posts around about how to do this, and believe I’m following the right approach, but I’m failing at the first hurdle. I can’t seem to get the Cloudwatch filters to work. At the basic level, I’d expect a variable Query like this…
ec2_instance_attribute(eu-west-1, InstanceId, { “tag:Name”: [ “prod-gizmo” ] } )
…to result in the InstanceId for just the EC2 instance named “prod-gizmo” in the eu-west-1 region. However, no matter what I put in the filters, apart from invalid JSON, the query seems to return all instance Id’s. I cannot get them to filter whatever I do. I’ve confirmed the permissions, using the awscli tool to query and filter, and it works as expected with the same credentials I’m using in Grafana, which are full admin credentials. I can get names using…
ec2_instance_attribute(eu-west-1, Tags:Name, {})
…and that works fine too, also returning the name of every instance. What I’d like to do, if I can get the filters to behave, is to have a second variable that uses the tag:Name(s) from the first to lookup ID’s that I can then use in the panels.
Any hints? I’m using the docker version of Grafana if that helps.
Cheers
Paul