Custom & Default Metrics Deep Dive
CloudWatch metrics are time-ordered sets of data points that represent the performance of your systems. They are the fundamental concept in CloudWatch and provide insights into resource utilization, application performance, and operational health.
Timestamped data points collected over time.
Aggregated insights using functions like Average, Sum, Min, Max.
Metrics are monitored by alarms to trigger automated responses.
Many AWS services provide free, default metrics for their resources. These are automatically collected and pushed to CloudWatch.
EC2 provides metrics at the hypervisor level.
Percentage of allocated EC2 compute units that are currently in use.
The number of bytes received on all network interfaces by the instance.
Completed read/write operations from all instance store volumes.
Reports whether the instance has passed both the instance status check and the system status check.
RDS provides metrics to monitor the health and performance of your database instances.
The percentage of CPU utilization for the database instance.
The number of client network connections to the database instance.
The amount of available random access memory.
The average number of disk I/O operations per second.
You can publish your own custom metrics to CloudWatch using the `PutMetricData` API call. This is essential for monitoring application-level performance, business metrics, or OS-level metrics not provided by default.
Use the `aws cloudwatch put-metric-data` command.
Use the `PutMetricData` API call in your application code.
The agent can be configured to publish custom metrics, including system-level metrics like memory usage.
A container for CloudWatch metrics. Metrics from different applications or services should be in different namespaces. Custom namespaces cannot start with "AWS/".
The name of the metric (e.g., "MemoryUtilization", "ProcessedOrders").
Name/value pairs that uniquely identify a metric. They are used for filtering and aggregation. You can have up to 10 dimensions per metric.
The numeric value of the data point.
The unit of measurement (e.g., "Percent", "Bytes", "Count").
aws cloudwatch put-metric-data --metric-name ProcessedOrders --namespace "MyWebApp" --value 150 --unit Count --dimensions Environment=Production
For applications that require faster insights, you can publish metrics at a high resolution, down to a 1-second interval. This allows for more granular monitoring and faster alarm triggering.