Cloudwatch filters not working

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

Is EC2 tag filtering available in your Grafana version?

BTW: EC2 dashboard (beta version) https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/blob/ec2-tag-filtering/aws-ec2/aws-ec2-tag-filtering.json - see also issue https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/issues/14

Hi,

I’m not sure how to determine if filtering is available or not. I’ve just used the standard docker image from here:

https://hub.docker.com/r/grafana/grafana/

Is there a simple way I can check the build/configuration to check if EC2 filtering is available?

Paul

Hello,

Anyone got any advice here? I’ve dug into the code that exists on the official docker image, can’t find anything in there that influences whether the EC2 filtering is available or not. I’ve got it setup to use a custom configuration file, so I can easily tweak any settings if someone could point me in the right direction to either fix this, or get more useful logging information out to find out what is failing.

Cheers

Paul

Maybe https://github.com/grafana/grafana/pull/8307#issuecomment-344715903