简体   繁体   English

Amazon Web Service CloudWatch具有维度的自定义指标

[英]Amazon Web Service CloudWatch custom metrics with dimensions

I'm trying to push data into a custom metric on AWS CloudWatch but wanted to find out more about the Dimensions and how these are used? 我正在尝试将数据推送到AWS CloudWatch上的自定义指标,但想要了解有关维度及其使用方式的更多信息? I've already read the AWS documentation but it doesn't really explain what they are used for and how it affects the graphing UI in the AWS Management Console. 我已经阅读了AWS文档,但它并没有真正解释它们的用途以及它如何影响AWS管理控制台中的图形用户界面。

Are Dimensions a way to breakdown the Metric Value further? Dimensions是否可以进一步细分度量值?

To give a fictitious example, say I have a metric which counts the number of people in a room. 举一个虚构的例子,说我有一个衡量一个房间里人数的指标。 The metric's name is called "Population". 度量标准的名称称为“Population”。 I report the count once a minute. 我每分钟报告一次。 The Metric Count is set to the number of people. 度量标准计数设置为人数。 The Dimension field is just a list of Name and Value pairs. Dimension字段只是Name和Value对的列表。 Assuming I report a datapoint with a value of 90, can I add two Dimensions as follows: 1. Name: Male, Count: 50 2. Name: Female, Count: 40 假设我报告一个值为90的数据点,我可以按如下方式添加两个维度:1。名称:男性,计数:50 2.名称:女性,计数:40

Any help will be greatly appreciated. 任何帮助将不胜感激。

Yes, you can add dimensions such as you described to your custom metrics. 是的,您可以将自己描述的维度添加到自定义指标中。

However, CloudWatch is NOT able to aggregate across these dimensions, as it doesn't know the groups of these dimensions. 然而,CloudWatch的是能够在这些方面聚集,因为它不知道这些尺寸的群体。 Basically: 基本上:

Amazon CloudWatch treats each unique combination of dimensions as a separate metric. Amazon CloudWatch将每个唯一维度组合视为单独的度量标准。 For example, each call to mon-put-data in the following figure creates a separate metric because each call uses a different set of dimensions. 例如,下图中每次调用mon-put-data都会创建一个单独的度量标准,因为每个调用都使用不同的维度集。 This is true even though all four calls use the same metric name (ServerStats). 即使所有四个调用都使用相同的度量标准名称(ServerStats),也是如此。

See more information about dimensions in CloudWatch here 此处查看有关CloudWatch中维度的更多信息

Do note that you can retrieve aggregated value from API , as well as plot a graph in CloudWatch using a math expression. 请注意,您可以从API检索聚合值,以及使用数学表达式在CloudWatch中绘制图表。 See Using metric math 请参阅使用度量数学

I should probably also add that you can NOT use metric math in alarms. 我还应该补充一点,你不能在警报中使用公制数学。

update: as @Brooks said Amazon CloudWatch Launches Ability to Add Alarms on Metric Math Expressions 更新:正如@Brooks所说, Amazon CloudWatch启动了在度量数学表达式上添加警报的能力

All in all pretty restricted and user-unfriendly compared eg to DataDog. 总而言之,与DataDog相比,它们非常受限制且对用户不友好。

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

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