Dynamic Cloudwatch Graph - Query by resource tag or autoscale - per node graph

0

Good afternoon. I setup a dynamic cloudwatch graph using the CW agent for disk space and an autoscaling group, so when a new instance gets launched, it starts graphing. That query looks like this'

SELECT AVG(mem_used_percent) FROM CWAgent WHERE AutoScalingGroupName = 'Collections' GROUP BY InstanceId

The problem is I am looking to do the same with the EC2 CPU Utilization so when a new instance launches or one gets replaced, it appears. So when I goto the insights/query, I add the Namespace AWS/EC2 and the Metric of MAX(CPUUtilization), all I get is one value. If I select by autoscaling group I get the max from each group, but I am trying to see a graph for all the instances in that group, so if there were 8 servers, show those 8 individual servers.

Thanks!

asked 9 months ago248 views
1 Answer
0

Hi, when you browse your AWS/EC2 metrics, you can see that there are different schemas: by autoscaling group, by AMI, per-instance metrics… It sounds to me like you might have selected the wrong schema. Each schema has a different set of dimensions, you can apply the WHERE filter and GROUP BY aggregation clauses only on the dimensions available in that schema. If you try to GROUP BY instance id metrics from the "by autoscaling group" schema, you won't get distinct metrics because the metrics in the "by autoscaling group" schema don't have the instance id dimension, they are already pre-aggregated. If you want to see a graph for all the instances, you need to select the "per-instance metrics" schema - however you will then not be able to display only one specific autoscaling group, as the autoscaling group is not published as a dimension for those metrics.

profile pictureAWS
Jsc
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions