如何动态更新AWS CloudWatch仪表板? [英] How can I dynamically update my AWS CloudWatch dashboards?

查看:86
本文介绍了如何动态更新AWS CloudWatch仪表板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CloudWatch中有几个仪表板,它们代表我的基础结构的静态视图,例如,当前正在运行自动伸缩工作组中的实例数量,或者各种关键EC2实例的CPU /磁盘状态。但是,当我添加新实例时,总是困在手动更新仪表板的过程中,以使其包含在显示中。

I have several dashboards in CloudWatch that represent a static view of my infrastructure, for instance, how many instances from an autoscaling worker group are currently running, or the CPU/disk status of various key EC2 instances. However, when I add new instances, I am always stuck manually updating the dashboards to include them in the display.

我很好奇是否有任何方法可以通过编程方式例如通过使用AWS Lambda函数的CLI / API调用填充这些仪表板?理想的情况是,仪表板可以基于触发器进行更新,类似于Lambda函数如何根据各种事件/时间表知道何时执行。

I'm curious if there is there any way to programmatically populate these dashboards, say through a CLI/API call using an AWS Lambda function? It would be ideal if dashboards could update based on triggers similarly to how Lambda functions know when to execute based on a variety of events/a schedule.

推荐答案

迟到总比没有好,似乎 CloudWatch已实现带有度量表达式的 SEARCH 函数。

Better late than never, it seems that CloudWatch has implemented a SEARCH function with metric expressions.

有很好的示例在文档中:

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

这篇关于如何动态更新AWS CloudWatch仪表板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆