Skip to main content

AWS CloudWatch Metrics

Metric

A metric is just a time-ordered set of data points being sent to CloudWatch so that you can get a nice graph on those time.

A metric is identified under three things:

  1. A namespace
  2. A metric name
  3. And 0 or more dimensions

Dimensions

A dimension is just simply a key-value pair that is part of a metric. You can assign each metric up to 10 dimensions. So basically each metric can have up to 10 of those key-value pairs.

However, you can have as many metrics of those 10 key-value pairs.

Dimensions are useful in that you can aggregate metrics together with same dimension keys.

What does Console Show?

When you click on metrics under CloudWatch you will first see namespace. Which is basically a container for all your metrics.

Then after you click into a namespace you will see category of dimension keys.

Say if you have instanceId as a dimension key, then you will see a category for metrics with instanceId as part of dimensions.

If you use say instanceId, instanceType two dimension key to identify metrics, then you will see a category for instanceId, InstanceType.

After you click into one, then you will see the actual metrics that are identified by the dimensions and the metric names.

Programmatically insert data

Whne you insert data you will need to specify the namespace, the metric name, and finally the dimension(s) in order to identify the metric. If the metric of the particular identification doesn't exist it will be created and data inserted.

If you want to delete a metric just don't insert anymore data into it and it will be deleted after a certain period of time.