CloudWatch Metrics: What It Is and When to Use It

Definition

Amazon CloudWatch Metrics is a fully managed monitoring service that provides a time-ordered set of data points, known as metrics, for your AWS resources and applications. It serves as a time-series database, enabling you to track resource utilization, application performance, and operational health to visualize trends, detect anomalies, and trigger automated actions.

How It Works

CloudWatch Metrics functions as a central repository for performance data. AWS services like Amazon EC2, Amazon RDS, and AWS Lambda automatically publish a set of standard metrics at no cost. You can also publish your own application-specific or business-level data points as custom metrics using the CloudWatch Agent or the PutMetricData API call.

Each data point is defined by several key components:

  • Namespace: A container that isolates metrics from different applications or AWS services. For example, metrics from EC2 instances are in the AWS/EC2 namespace, while custom metrics from an on-premises server might be in a namespace like CWAgent.
  • Metric Name: The name of the specific variable being measured, such as CPUUtilization or NetworkIn.
  • Dimensions: Key-value pairs that uniquely identify a metric, acting as filters or categories. For example, an EC2 CPUUtilization metric is uniquely identified by the InstanceId dimension. You can assign up to 30 dimensions to a metric.
  • Timestamp: The time at which the data point was recorded, making CloudWatch a time-series database.
  • Value: The numerical value of the data point (e.g., 85 for 85% CPU).
  • Unit: The unit of measurement, such as Percent, Bytes, or Count.

The typical data flow involves a resource or application publishing data points to the CloudWatch service. CloudWatch then aggregates this data over specified periods. You can access this aggregated data through the AWS Management Console to create graphs and dashboards, or programmatically via the GetMetricData API to power alarms and third-party tools.

Metrics can be published at two different granularities:

  • Standard Resolution: Data is stored with a 1-minute granularity.
  • High Resolution: Data can be stored with a 1-second granularity, providing more immediate insight for sub-minute activity, though at a higher cost.

Key Features and Limits

  • Standard vs. Custom Metrics: Most AWS services provide standard metrics for free (e.g., EC2 CPU, Lambda invocations). Custom metrics allow you to monitor application-specific data points (e.g., active user sessions, transaction latency).
  • Metric Math: You can perform mathematical calculations on one or more metrics to create new, derived time series for more advanced insights, such as calculating an error rate percentage.
  • Metric Streams: Create a continuous, near-real-time stream of metrics to a destination of your choice, such as Amazon Kinesis Data Firehose. This is commonly used to send CloudWatch metrics to third-party monitoring platforms like Datadog or New Relic, or to an Amazon S3 bucket for long-term analysis.
  • High-Resolution Metrics: Publish metrics at a 1-second frequency for latency-sensitive workloads that require rapid feedback.
  • Metric Retention: CloudWatch retains metric data for 15 months, but the granularity decreases over time.
    • Data points with a period of less than 60 seconds are available for 3 hours.
    • 1-minute data points are available for 15 days.
    • 5-minute data points are available for 63 days.
    • 1-hour data points are available for 455 days (15 months).
  • Service Quotas (as of 2026):
    • Dimensions per Metric: You can assign up to 30 dimensions to a single metric.
    • Metric Filters per Log Group: You can create up to 100 metric filters per log group to extract metrics from log data.
    • API Limits: The PutLogEvents API has a limit of 5 requests per second per log stream.

Common Use Cases

  1. Infrastructure Performance Monitoring: Track fundamental metrics like CPUUtilization, NetworkIn/Out, and DiskReadOps/WriteOps for Amazon EC2 instances to ensure performance and plan capacity.
  2. Application Health and KPI Tracking: Publish custom metrics from your application code to monitor business-critical key performance indicators (KPIs), such as user sign-ups, items in a shopping cart, or the processing time of a specific function.
  3. Automated Scaling and Remediation: Use metrics as the input for CloudWatch Alarms. These alarms can trigger actions like scaling an Amazon EC2 Auto Scaling group up or down, stopping or rebooting an instance, or invoking an AWS Lambda function for custom remediation.
  4. Serverless Function Optimization: Monitor AWS Lambda function metrics like Invocations, Errors, Duration, and Throttles to identify performance bottlenecks, optimize execution time, and manage costs.
  5. Database Performance Tuning: Observe key metrics for Amazon RDS, such as DatabaseConnections, ReadLatency, and WriteLatency, to diagnose database performance issues and ensure a smooth user experience.

Pricing Model

CloudWatch Metrics has a multi-dimensional pricing model with a permanent free tier.

  • Free Tier: The free tier includes 10 custom metrics, 10 alarms, 1 million API requests, and 3 dashboards (with up to 50 widgets each) per month. Basic monitoring metrics from AWS services are also free.
  • Custom Metrics: You are billed per custom metric per month, with tiered pricing that decreases as your volume of metrics increases.
  • API Requests: API calls like GetMetricData and PutMetricData are billed per 1,000 requests beyond the free tier.
  • Alarms: Alarms are priced per alarm per month. High-resolution alarms (evaluating every 10 or 30 seconds) cost more than standard-resolution alarms (evaluating every 60 seconds).
  • Metric Streams: Billed based on the number of metric updates streamed.

High-resolution custom metrics are more expensive than standard-resolution ones. For detailed and up-to-date pricing, always consult the official AWS Pricing page and calculator.

Pros and Cons

Pros:

  • Deep AWS Integration: Native, zero-setup integration with over 70 AWS services, providing immediate visibility into your infrastructure.
  • Fully Managed and Scalable: As a managed service, it handles all the operational overhead of running a monitoring system at scale.
  • Foundation for Automation: Tightly integrated with CloudWatch Alarms, Amazon EventBridge, and AWS Auto Scaling to enable automated responses to operational changes.
  • Flexible Custom Metrics: The ability to publish custom metrics from any source (AWS or on-premises) provides comprehensive application-level visibility.

Cons:

  • Cost at Scale: Costs can become significant and hard to predict for workloads with a high volume of custom metrics, high-resolution metrics, or heavy API usage.
  • Agent Required for System-Level Metrics: Default EC2 metrics do not include memory, disk space, or process-level details; these require installing and configuring the CloudWatch Agent.
  • Limited Query Language: While Metrics Insights offers a SQL-based query language, it is less powerful and flexible than specialized languages like PromQL used by Prometheus.
  • Visualization Limitations: The built-in dashboarding capabilities are functional but can be less advanced and intuitive compared to specialized third-party tools like Grafana or Datadog.

Comparison with Alternatives

  • CloudWatch Metrics vs. CloudWatch Logs: These are complementary services. Metrics are numerical time-series data used for performance monitoring and trending (the "what"). Logs are verbose, text-based records of discrete events used for deep diagnostics and root cause analysis (the "why"). You can use Metric Filters to extract numerical data points from logs and publish them as CloudWatch Metrics.

  • CloudWatch Metrics vs. Prometheus: Prometheus is a popular open-source monitoring system. CloudWatch is a fully managed, push-based service deeply integrated into AWS. Prometheus is typically self-hosted, uses a pull-based model to scrape metrics from endpoints, and offers a more powerful query language (PromQL). Many organizations use CloudWatch for AWS infrastructure metrics and Prometheus for application and Kubernetes-level metrics, often visualizing both in Grafana.

Exam Relevance

CloudWatch Metrics is a fundamental topic on several AWS certification exams, particularly those focused on architecture, operations, and development.

  • Certifications: AWS Certified Solutions Architect (Associate and Professional), AWS Certified SysOps Administrator - Associate, AWS Certified Developer - Associate, AWS Certified DevOps Engineer - Professional.
  • Key Topics to Know:
    • The difference between standard metrics (free, from AWS services) and custom metrics (paid, from your applications).
    • The requirement of the CloudWatch Agent to get memory and disk space metrics from Amazon EC2 instances.
    • Core concepts: Namespaces, Dimensions, Statistics, and Resolution.
    • The relationship between Metrics, Alarms, and automated actions (e.g., SNS notifications, Auto Scaling).
    • The difference between standard resolution (1-minute) and high-resolution (1-second) metrics and their cost implications.
    • Metric retention policies and how granularity changes over time.

Frequently Asked Questions

Q: How can I monitor memory utilization on an Amazon EC2 instance?

A: By default, Amazon EC2 does not send OS-level metrics like memory or disk space utilization to CloudWatch. To collect these, you must install the unified CloudWatch Agent on your EC2 instance. After configuring the agent, it will publish these system-level metrics as custom metrics to a specified namespace (typically CWAgent), which you can then graph and alarm on.

Q: What is the difference between a CloudWatch Metric and a CloudWatch Alarm?

A: A Metric is the raw, time-series data representing a variable over time (e.g., CPUUtilization). An Alarm is a separate object that watches a single metric over a specified time period. It performs one or more actions based on the value of the metric relative to a defined threshold over a number of time periods. For example, an alarm can trigger an SNS notification or an Auto Scaling action when the average CPUUtilization metric exceeds 80% for 5 consecutive minutes.

Q: How long is CloudWatch metric data stored?

A: CloudWatch retains all metrics for 455 days (approximately 15 months), but the data resolution decreases over time. High-resolution data (less than 60-second periods) is kept for 3 hours. Data with a 1-minute period is kept for 15 days. Data with a 5-minute period is kept for 63 days, and data with a 1-hour period is kept for the full 455 days.


This article reflects AWS features and pricing as of 2026. AWS services evolve rapidly — always verify against the official AWS documentation before making production decisions.

Published: 6/18/2026 / Updated: 6/18/2026

This article is for informational purposes only. AWS services, pricing, and features change frequently — always verify details against the official AWS documentation before making production decisions.

More in Monitoring