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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠