23

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? 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.

Are Dimensions a way to breakdown the Metric Value further?

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". 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. 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

Any help will be greatly appreciated.

millie
  • 2,642
  • 10
  • 39
  • 58

2 Answers2

18

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. Basically:

Amazon CloudWatch treats each unique combination of dimensions as a separate metric. 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. This is true even though all four calls use the same metric name (ServerStats).

See more information about dimensions in CloudWatch here

Guy
  • 12,388
  • 3
  • 45
  • 67
  • 1
    The documentation says EC2 metrics are aggregated across dimensions, but I wonder about other AWS services -- they don't specify. – spieden Jun 23 '16 at 00:17
  • @spieden link to documentation? It's supposed to aggregate across values or a dimension, but not across various combinations of dimensions. – Kashyap Aug 01 '18 at 21:34
  • For above cases as mentioned by @Guy the new metrics is made every call to mon-put-data. What I am wondering here is how to show the latest metrics to graph or how does it get reflected to graph. suppose for previous metrics it was 90 and it got reduced to 80. One option is manually choosing the new metrics but that is not a solution. – Tara Prasad Gurung May 22 '19 at 09:06
4

Do note that you can retrieve aggregated value from API, as well as plot a graph in CloudWatch using a math expression. 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

All in all pretty restricted and user-unfriendly compared e.g. to DataDog.

Kashyap
  • 15,354
  • 13
  • 64
  • 103