Create dynamic cross account CloudWatch Dashboard

1

Currently any time I add an EC2 instance, I need to manually add the metric to the existing widget(s) in my CloudWatch Dashboard. I know there are Automatic Dashboards that are "Resource Aware" so that any time a new instance is added/removed their respective widgets are updated accordingly automatically. How do I mirror that capability in my widgets for cross account dashboards?

AWS
AWSJoe
已提问 2 年前747 查看次数
1 回答
1

Hi Joe,

Thanks for your question. Keeping your Dashboard dynamically up to date is no easy job but with Metrics Explorer [1] and Search Expression [2] it can be tackled quite simply.

Metrics Explorer is a feature that allows you to dynamically populate metrics by the resource tags. For instance in your case, we can filter by the Instance Name tag or any other tag that you find common around the EC2 instances that you dynamically want to monitor on your Dashboard. Metrics Explorer Console view example

Once you create the graphs on your Explorer, you can add it as a Metrics Explorer widget to the Dashboard.

Alternatively, Search Expression can be also used here and it supports searching by the Namespace, Metric Name, Dimension Name and Dimension Values. For instance you can use below search expression to find all the CPUUtilization metrics from AWS/EC2 namespace with InstanceId schema(which is the dimension list for that metric).

SEARCH('{AWS/EC2,InstanceId} MetricName="CPUUtilization"', 'Average', 300)

Search Expression example

Please check the related documents for detail information and including the limitations as well.

Hope this helps!

Thanks

AWS
支持工程师
已回答 2 年前
  • Hi @Munkhbat_T, I appreciate your answer! I've used Metric Explorer in the past without issue, my blocker here is that it's only of use in a singular account. I was wondering if there's a way to do the same type of build out for cross account dashboards.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则