Amazon CloudWatch のアイコン

Amazon CloudWatch Essential2009年〜

A service that provides monitoring, log management, and alarms for AWS resources and applications

What It Does

Amazon CloudWatch collects, visualizes, and monitors metrics (numerical data), logs, and events from AWS resources and applications. It displays metrics like CPU utilization and memory usage on real-time dashboards and sends alarm notifications when thresholds are exceeded. With built-in log aggregation, search, and analysis capabilities, CloudWatch serves as a centralized operations monitoring platform for your AWS environment.

Use Cases

CloudWatch is used across all operational monitoring scenarios: auto-scaling EC2 instances when CPU utilization exceeds 80%, sending Slack notifications when Lambda function error rates spike, searching application logs for specific error patterns, and much more.

Everyday Analogy

Think of it like a car dashboard. The dashboard displays gauges for speed, fuel level, engine RPM, and coolant temperature, letting you check the car's status in real time. Warning lights come on when something is wrong. CloudWatch is the dashboard for your AWS environment, monitoring the status of each service and alerting you with alarms when problems arise.

What Is CloudWatch?

Amazon CloudWatch is the core operations monitoring service for AWS. Nearly all AWS services, including EC2, Lambda, RDS, and S3, automatically send metrics to CloudWatch. You can visualize these metrics in graphs, set thresholds to trigger alarms, and aggregate logs for search and analysis. It is an essential service for stable AWS environment operations.

Metrics and Alarms

Metrics are time-series numerical data representing the state of AWS resources. Examples include EC2's CPUUtilization and Lambda's Errors count. Alarms set thresholds on metrics and trigger actions (SNS notifications, Auto Scaling, Lambda execution, etc.) when conditions are met. For example, you can configure an alarm for "notify when CPU utilization exceeds 80% for 5 consecutive minutes."

CloudWatch Logs

CloudWatch Logs is a service for aggregating, storing, and searching application and system logs. Lambda function execution logs are automatically sent to CloudWatch Logs. For EC2 instance logs, install the CloudWatch Agent to send them. The Logs Insights feature lets you search and analyze logs at high speed using a SQL-like query language. For example, you can run queries like "show error logs from the past hour sorted by frequency." For practical know-how on CloudWatch Logs, you can also learn from specialized books on Amazon.

Getting Started

CloudWatch is available as soon as you create an AWS account. When you open the CloudWatch console, basic metrics from your AWS resources are already being collected. Create a dashboard, add metric graphs, and set up alarms to establish a basic monitoring setup. To send custom metrics (application-specific values), use the PutMetricData API from the AWS SDK.

Things to Watch Out For

  • Basic metrics are free, but detailed monitoring (1-minute intervals) and custom metrics incur additional charges. Consider whether standard monitoring (5-minute intervals) is sufficient to keep costs down
  • CloudWatch Logs retention is unlimited by default. Unnecessary log accumulation increases storage costs, so set appropriate retention periods for each log group
  • If alarm evaluation periods and thresholds are not properly configured, temporary spikes can cause frequent false alarms. Requiring consecutive threshold breaches across multiple periods helps reduce false positives
共有するXB!