Skip to content

How to delete the dimensions in metric

0

I have some dimensions in my cloudwatch metric and I need to delete some of the dimensions alone how to delete that

asked a year ago209 views

1 Answer
0

Dimensions in CloudWatch metrics are part of the metric's identity and cannot be deleted directly from an existing metric. A dimension is a name/value pair that helps identify a specific variation of a metric. When you add a unique name/value pair to a metric, you're essentially creating a new variation of that metric.

If you're using the CloudWatch Agent and want to remove certain dimensions from metrics being collected, you can modify your CloudWatch Agent configuration file. For example, to remove the device dimension from disk metrics, you can add "drop_device": true to the disk section in your configuration file.

For AWS Lambda using Python with the Powertools library, you can use the clear_default_dimensions method to remove default dimensions that were previously set.

In AWS IoT Device Defender, you can delete dimensions by:

  1. First ensuring the dimension isn't attached to a security profile (check the "Security Profiles" column)
  2. If it is attached, edit the security profile to remove the reference to the dimension
  3. Select the dimension and choose "Delete"
  4. Enter the dimension name to confirm deletion

Remember that metrics in CloudWatch are not resources that can be created or deleted like typical AWS resources. They are data time series that get indexed when you ingest data to them. The metric name (namespace, name, and dimensions) stays in the index for up to 2 weeks after the last data ingestion.
Sources
Dimension - Amazon CloudWatch
Metrics - Powertools for AWS Lambda (Python)
CloudWatch Agent Aggrerate Disk Metric | AWS re:Post
Scoping metrics in security profiles using dimensions - AWS IoT Device Defender
AWS Cloudwatch Metric | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.