- Newest
- Most votes
- Most comments
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:
- First ensuring the dimension isn't attached to a security profile (check the "Security Profiles" column)
- If it is attached, edit the security profile to remove the reference to the dimension
- Select the dimension and choose "Delete"
- 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
Relevant content
asked 7 months ago
asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
