| Did this page help you? Yes No Tell us about it... |
Gets statistics for the specified metric.
![]() | Note |
|---|---|
The maximum number of data points returned from a single
GetMetricStatistics request is 1,440.
If a request is made that generates more than 1,440 data points,
Amazon CloudWatch returns an error. In such a case,
alter the request by narrowing the specified time range
or increasing the specified period. Alternatively,
make multiple requests across adjacent time ranges.
|
Amazon CloudWatch aggregates data points based on the
length of the period that you specify.
For example, if you request statistics with a one-minute granularity,
Amazon CloudWatch aggregates data points with time stamps that fall
within the same one-minute period. In such a case,
the data points queried can greatly outnumber the data points returned.
![]() | Note |
|---|---|
| The maximum number of data points that can be queried is 50,850; whereas the maximum number of data points returned is 1,440. |
The following examples show various statistics allowed by the data point query maximum of 50,850
when you call GetMetricStatistics on Amazon EC2 instances with
detailed (one-minute) monitoring enabled:
For information about the namespace, metric names, and dimensions that other Amazon Web Services products use to send metrics to Cloudwatch, go to CloudWatch Support for AWS Products in the Amazon CloudWatch Developer Guide.
For information about the common parameters that all actions use, see Common Query Parameters.
| Name | Description | Required | |||
|---|---|---|---|---|---|
Dimensions.member.N
|
A list of dimensions describing qualities of the metric. Type: Dimension list Length constraints: Minimum of 0 item(s) in the list. Maximum of 10 item(s) in the list. | No | |||
EndTime
|
The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified. Type: DateTime | Yes | |||
MetricName
|
The name of the metric. Type: String Length constraints: Minimum length of 1. Maximum length of 255. | Yes | |||
Namespace
|
The namespace of the metric. Type: String Length constraints: Minimum length of 1. Maximum length of 255. | Yes | |||
Period
|
The granularity, in seconds, of the returned datapoints.
Type: Integer | Yes | |||
StartTime
|
The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified.
Type: DateTime | Yes | |||
Statistics.member.N
|
The metric statistics to return. For information about specific statistics returned by GetMetricStatistics, go to Statistics in the Amazon CloudWatch Developer Guide.
Valid Values: Type: String list Length constraints: Minimum of 1 item(s) in the list. Maximum of 5 item(s) in the list. | Yes | |||
Unit
|
The unit for the metric. Type: String
Valid Values: | Yes |
GetMetricStatisticsResult
structure.
| Name | Description |
|---|---|
Datapoints
|
The datapoints for the specified metric. Type: Datapoint list |
Label
|
A label describing the specified metric. Type: String |
For information about the common errors that all actions use, see Common Errors.
| Error | Description | HTTP Status Code |
|---|---|---|
InternalService
|
Indicates that the request processing has failed due to some unknown error, exception, or failure. | 500 |
InvalidParameterCombination
|
Parameters that must not be used together were used together. | 400 |
InvalidParameterValue
|
Bad or out-of-range value was supplied for the input parameter. | 400 |
MissingRequiredParameter
|
An input parameter that is mandatory for processing the request is not supplied. | 400 |