Get statistics for a specific instance - Amazon Elastic Compute Cloud

Get statistics for a specific instance

You can use the AWS Management Console or the AWS CLI to get statistics for a specific instance. The following examples show you how to use the AWS Management Console or the AWS CLI to determine the maximum CPU utilization of a specific EC2 instance.

Requirements
To display the CPU utilization for a specific instance (console)
  1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. In the navigation pane, choose Metrics.

  3. Choose the EC2 metric namespace.

  4. Choose the Per-Instance Metrics dimension.

  5. In the search field, enter CPUUtilization and press Enter. Choose the row for the specific instance, which displays a graph for the CPUUtilization metric for the instance. To name the graph, choose the pencil icon. To change the time range, select one of the predefined values or choose custom.

    Graph a single metric
  6. To change the statistic or the period for the metric, choose the Graphed metrics tab. Choose the column heading or an individual value, and then choose a different value.

    Change the statistic or period for a metric
To get the CPU utilization for a specific instance (AWS CLI)

Use the following get-metric-statistics command to get the CPUUtilization metric for the specified instance, using the specified period and time interval:

aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization --period 3600 \ --statistics Maximum --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \ --start-time 2022-10-18T23:18:00 --end-time 2022-10-19T23:18:00

The following is example output. Each value represents the maximum CPU utilization percentage for a single EC2 instance.

{ "Datapoints": [ { "Timestamp": "2022-10-19T00:18:00Z", "Maximum": 0.33000000000000002, "Unit": "Percent" }, { "Timestamp": "2022-10-19T03:18:00Z", "Maximum": 99.670000000000002, "Unit": "Percent" }, { "Timestamp": "2022-10-19T07:18:00Z", "Maximum": 0.34000000000000002, "Unit": "Percent" }, { "Timestamp": "2022-10-19T12:18:00Z", "Maximum": 0.34000000000000002, "Unit": "Percent" }, ... ], "Label": "CPUUtilization" }