Get statistics for a specific resource - Amazon CloudWatch

Get statistics for a specific resource

The following example shows you how to determine the maximum CPU utilization of a specific EC2 instance.

To display the average CPU utilization for a specific instance using the console
  1. Open the CloudWatch console at

  2. In the navigation pane, choose Metrics.

  3. Select the EC2 metric namespace.

    Select the EC2 metrics namespace
  4. Select the Per-Instance Metrics dimension.

    View the metric dimensions for Amazon EC2
  5. In the search field, enter CPUUtilization and press Enter. Select the row for the specific instance, which displays a graph for the CPUUtilization metric for the instance. To change the name of 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, choose the Graphed metrics tab. Choose the column heading or an individual value and then choose one of the statistics or predefined percentiles, or specify a custom percentile (for example, p99.999).

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

To get the CPU utilization per EC2 instance using the AWS CLI

Use the get-metric-statistics command as follows to get the CPUUtilization metric for the specified instance.

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

The returned statistics are 6-minute values for the requested 24-hour time interval. Each value represents the maximum CPU utilization percentage for the specified instance for a particular 6-minute time period. The data points aren't returned in chronological order. The following shows the beginning of the example output (the full output includes data points for every 6 minutes of the 24-hour period).

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