AWS CloudWatch

Anatomy of Alarms

Built in and Custom Metrics

In this guide, we’ll explore the three primary metric types in AWS CloudWatch—built-in metrics, custom metrics, and usage metrics—and demonstrate how to apply them when monitoring an RDS instance in a VPC. By the end, you’ll understand how to gain a comprehensive view of your resource health, application performance, and usage quotas.

1. Metric Types Overview

CloudWatch collects and organizes data into different metric categories. Leveraging all three types helps you:

  • Track core resource performance
  • Gather application-specific insights
  • Monitor service consumption against quotas
Metric TypeSourceUse Case
Built-inAWS-managed (70+ services)CPU, disk I/O, network throughput, memory usage
CustomUser-defined via API or SDKTransaction counts, cache hit rates, API response times
UsageAWS service quotas and usage statisticsTrack service limits, forecast capacity, avoid overruns

The image is a flowchart illustrating the types of metrics: "Published by AWS," "Custom Metrics," and "Usage Metrics," under the main category "Metrics."

1.1 Built-in Metrics

CloudWatch automatically publishes metrics for over 70 AWS services. Examples include:

  • CPUUtilization
  • NetworkIn / NetworkOut
  • DiskReadBytes / DiskWriteBytes

Note

Built-in metrics have a default 1-minute resolution. To enable 1-second (high-resolution) metrics for supported services, see the CloudWatch detailed monitoring documentation.

1.2 Custom Metrics

When default metrics aren’t enough, you can push any numeric data via the PutMetricData API. Common examples:

  • Order processing rate
  • Cache hit ratio
  • Endpoint response time

Warning

Custom metrics incur additional charges. Review the CloudWatch pricing page before publishing high-cardinality or high-frequency data.

1.3 Usage Metrics

Usage metrics track how close you are to AWS service quotas (limits). These are crucial for:

  • Monitoring API call volumes
  • Ensuring you don’t exceed resource limits
  • Forecasting future capacity needs

2. Practical Example: Monitoring RDS in a VPC

Let’s apply these metric types to an Amazon RDS instance running in a Virtual Private Cloud.

The image illustrates a diagram of AWS cloud infrastructure, focusing on a Virtual Private Cloud (VPC) with AWS RDS, and highlights built-in and custom metrics for monitoring, such as CPU utilization and average query execution time.

2.1 Built-in RDS Metrics

AWS RDS publishes dozens of metrics by default. Key ones include:

Metric NameDescriptionUnit
CPUUtilizationPercentage of CPU in usePercent (%)
FreeableMemoryAvailable RAM in the instanceBytes
ReadIOPS / WriteIOPSDisk read/write operations per secCount/sec
DatabaseConnectionsActive connections to the DBCount

2.2 Custom RDS Metrics

Enhance observability with application-specific data:

Metric NameDescriptionCollection Interval
LoginsPerMinuteNumber of successful user logins1 minute
AvgQueryExecutionTimeAverage time to execute SQL queries1 minute
CacheHitRatioPercentage of cache hits vs. total requests1 minute

Note

Use the AWS SDK or CLI command aws cloudwatch put-metric-data to publish custom metrics from your application or monitoring scripts.

3. Next Steps

With metrics in place, you can now:

  • Set up CloudWatch Alarms to get notified on thresholds
  • Build CloudWatch Dashboards for real-time visualization
  • Integrate with AWS CloudWatch Logs for log monitoring

Watch Video

Watch video content

Previous
What are Metrics and Metric Dimensions