Amazon CloudWatch is basically a metrics repository. An AWS service—such as Amazon EC2—puts metrics into the repository, and you retrieve statistics based on those metrics. If you put your own custom metrics into the repository, you can retrieve statistics on these metrics as well. Show You can use metrics to calculate statistics and then present the data graphically in the CloudWatch console. For more information about the other AWS resources that generate and send metrics to CloudWatch, see AWS services that publish CloudWatch metrics. You can configure alarm actions to stop, start, or terminate an Amazon EC2 instance when certain criteria are met. In addition, you can create alarms that initiate Amazon EC2 Auto Scaling and Amazon Simple Notification Service (Amazon SNS) actions on your behalf. For more information about creating CloudWatch alarms, see Alarms. AWS Cloud computing resources are housed in highly available data center facilities. To provide additional scalability and reliability, each data center facility is located in a specific geographical area, known as a Region. Each Region is designed to be completely isolated from the other Regions, to achieve the greatest possible failure isolation and stability. Metrics are stored separately in Regions, but you can use CloudWatch cross-Region functionality to aggregate statistics from different Regions. For more information, see Cross-account cross-Region CloudWatch console and Regions and Endpoints in the Amazon Web Services General Reference. You can monitor your instances using Amazon CloudWatch, which collects and processes raw data from Amazon EC2 into readable, near real-time metrics. These statistics are recorded for a period of 15 months, so that you can access historical information and gain a better perspective on how your web application or service is performing. By default, Amazon EC2 sends metric data to CloudWatch in 5-minute periods. To send metric data for your instance to CloudWatch in 1-minute periods, you can enable detailed monitoring on the instance. For more information, see Enable or turn off detailed monitoring for your instances. The Amazon EC2 console displays a series of graphs based on the raw data from Amazon CloudWatch. Depending on your needs, you might prefer to get data for your instances from Amazon CloudWatch instead of the graphs in the console. For more information about Amazon CloudWatch, see the Amazon CloudWatch User Guide. Metrics are data about the performance of your systems. By default, many services provide free metrics for resources (such as Amazon EC2 instances, Amazon EBS volumes, and Amazon RDS DB instances). You can also enable detailed monitoring for some resources, such as your Amazon EC2 instances, or publish your own application metrics. Amazon CloudWatch can load all the metrics in your account (both AWS resource metrics and application metrics that you provide) for search, graphing, and alarms. Metric data is kept for 15 months, enabling you to view both up-to-the-minute data and historical data. To graph metrics in the console, you can use CloudWatch Metrics Insights, a high-performance SQL query engine that you can use to identify trends and patterns within all your metrics in real time. Amazon EC2 sends metrics to Amazon CloudWatch. You can use the AWS Management Console, the AWS CLI, or an API to list the metrics that Amazon EC2 sends to CloudWatch. By default, each data point covers the 5 minutes that follow the start time of activity for the instance. If you've enabled detailed monitoring, each data point covers the next minute of activity from the start time. Note that for the Minimum, Maximum, and Average statistics, the minimum granularity for the metrics that EC2 provides is 1 minute. For information about getting the statistics for these metrics, see Get statistics for metrics for your instances. Instance metricsThe AWS/EC2 namespace includes the following instance metrics.
The AWS/EC2 namespace includes the following CPU credit metrics for your burstable performance instances.
Dedicated Host metricsThe AWS/EC2 namespace includes the following metrics for T3 Dedicated Hosts.
Amazon EBS metrics for Nitro-based instancesThe AWS/EC2 namespace includes the following Amazon EBS metrics for the Nitro-based instances. For the list of Nitro-based instance types, see Instances built on the Nitro System.
For information about the metrics provided for your EBS volumes, see Amazon EBS metrics. For information about the metrics provided for your Spot fleets, see CloudWatch metrics for Spot Fleet. Status check metricsThe AWS/EC2 namespace includes the following status check metrics. By default, status check metrics are available at a 1-minute frequency at no charge. For a newly-launched instance, status check metric data is only available after the instance has completed the initialization state (within a few minutes of the instance entering the running state). For more information about EC2 status checks, see Status checks for your instances.
Traffic mirroring metricsThe AWS/EC2 namespace includes metrics for mirrored traffic. For more information, see Monitor mirrored traffic using Amazon CloudWatch in the Amazon VPC Traffic Mirroring Guide. Auto Scaling group metricsThe AWS/AutoScaling namespace includes metrics for Auto Scaling groups. For more information, see Monitor CloudWatch metrics for your Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide. Amazon EC2 metric dimensionsYou can use the following dimensions to refine the metrics listed in the previous tables.
Amazon EC2 usage metricsYou can use CloudWatch usage metrics to provide visibility into your account's usage of resources. Use these metrics to visualize your current service usage on CloudWatch graphs and dashboards. Amazon EC2 usage metrics correspond to AWS service quotas. You can configure alarms that alert you when your usage approaches a service quota. For more information about CloudWatch integration with service quotas, see AWS usage metrics in the Amazon CloudWatch User Guide. Amazon EC2 publishes the following metrics in the AWS/Usage namespace.
The following dimensions are used to refine the usage metrics that are published by Amazon EC2.
List metrics using the consoleMetrics are grouped first by namespace, and then by the various dimension combinations within each namespace. For example, you can view all metrics provided by Amazon EC2, or metrics grouped by instance ID, instance type, image (AMI) ID, or Auto Scaling group. To view available metrics by category (console)
List metrics using the AWS CLIUse the list-metrics command to list the CloudWatch metrics for your instances. To list all the available metrics for Amazon EC2 (AWS CLI) The following example specifies the AWS/EC2 namespace to view all the metrics for Amazon EC2. aws cloudwatch list-metrics --namespace AWS/EC2The following is example output: { "Metrics": [ { "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ], "MetricName": "NetworkOut" }, { "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ], "MetricName": "CPUUtilization" }, { "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ], "MetricName": "NetworkIn" }, ... ] }To list all the available metrics for an instance (AWS CLI) The following example specifies the AWS/EC2 namespace and the InstanceId dimension to view the results for the specified instance only. aws cloudwatch list-metrics --namespace AWS/EC2 --dimensions Name=InstanceId,Value=i-1234567890abcdef0To list a metric across all instances (AWS CLI) The following example specifies the AWS/EC2 namespace and a metric name to view the results for the specified metric only. aws cloudwatch list-metrics --namespace AWS/EC2 --metric-name CPUUtilization |