简体   繁体   English

跨维度查询AWS CloudWatch自定义指标

[英]Query AWS CloudWatch custom metrics across dimensions

I recently added the ability for my application to upload custom metrics to AWS CloudWatch so that we can better monitor the performance characteristics of the system. 我最近为我的应用程序添加了将自定义指标上传到AWS CloudWatch的功能,以便我们可以更好地监视系统的性能特征。

I am now trying to create a report by querying those collected custom metrics using the AWS CloudWatch CLI. 我现在正在尝试通过使用AWS CloudWatch CLI查询那些收集的自定义指标来创建报告。 However, I've come across a seemingly insurmountable problem, namely, the inability to aggregate statistics across dimensions for custom metrics emitted using PutMetricData as per this article . 但是,我遇到了一个看似无法解决的问题,即,对于本文所述的使用PutMetricData发出的自定义指标,无法跨维度汇总统计信息。

Is anyone aware of a way to specify dimension values using something like wildcards or regular expressions (eg *,?,.+ etc) ? 有谁知道使用通配符或正则表达式(例如*,?,。+等)指定维值的方法吗?

You can't query across dimensions, but you can create additional summary metrics to roll up the same data. 您无法跨维度进行查询,但是可以创建其他汇总指标来汇总相同的数据。 For example, if you were recording messages processed on behalf of your customers, you might put metric data twice for each message -- one to the summary message count, and one to the message count with the customer as a dimension. 例如,如果您要记录代表客户处理的消息,则可以为每条消息放置两次度量标准数据-一个到摘要消息计数,一个到消息计数(以客户为维度)。 It's a bit redundant, but it works. 这有点多余,但是可以。

If you take a look at the metrics set up in CloudWatch for an Elastic Load Balancer, you'll see the same metrics recorded several ways to summarize by availability zone, load balancer, load balancer and AZ, etc. 如果查看一下CloudWatch中为Elastic Load Balancer设置的指标,您会看到相同的指标记录了几种按可用性区域,负载均衡器,负载均衡器和AZ等进行汇总的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM