AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Get-CWMetricData-UtcEndTime <DateTime>-MaxDatapoint <Int32>-MetricDataQuery <MetricDataQuery[]>-ScanBy <ScanBy>-UtcStartTime <DateTime>-LabelOptions_Timezone <String>-EndTime <DateTime>-NextToken <String>-StartTime <DateTime>-Select <String>
GetMetricData
API to retrieve CloudWatch metric values. The operation can also include a CloudWatch Metrics Insights query, and one or more metric math functions.
A GetMetricData
operation that does not include a query can retrieve as many as 500 different metrics in a single request, with a total of as many as 100,800 data points. You can also optionally perform metric math expressions on the values of the returned statistics, to create new time series that represent new insights into your data. For example, using Lambda metrics, you could divide the Errors metric by the Invocations metric to get an error rate time series. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide.
If you include a Metrics Insights query, each GetMetricData
operation can include only one query. But the same GetMetricData
operation can also retrieve other metrics. Metrics Insights queries can query only the most recent three hours of metric data. For more information about Metrics Insights, see Query your metrics with CloudWatch Metrics Insights.
Calls to the GetMetricData
API have a different pricing structure than calls to GetMetricStatistics
. For more information about pricing, see Amazon CloudWatch Pricing.
Amazon CloudWatch retains metric data as follows: StorageResolution
of 1. Unit
in your request, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions. Using Metrics Insights queries with metric math You can't mix a Metric Insights query and metric math syntax in the same expression, but you can reference results from a Metrics Insights query within other Metric math expressions. A Metrics Insights query without a GROUP BY clause returns a single time-series (TS), and can be used as input for a metric math expression that expects a single time series. A Metrics Insights query with a GROUP BY clause returns an array of time-series (TS[]), and can be used as input for a metric math expression that expects an array of time series. StartTime
and EndTime
values that align with the value of the metric's Period
and sync up with the beginning and end of an hour. For example, if the Period
of a metric is 5 minutes, specifying 12:05 or 12:30 as EndTime
can get a faster response from CloudWatch than setting 12:07 or 12:29 as the EndTime
.This parameter is deprecated. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
+
or -
followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time zone that is 1 hour and 30 minutes ahead of UTC. The default is +0000. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | MaxDatapoints |
GetMetricData
call can include as many as 500 MetricDataQuery
structures. Each of these structures can specify either a metric to retrieve, a Metrics Insights query, or a math expression to perform on retrieved data. Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | MetricDataQueries |
GetMetricData
operation, to get the next set of data points.Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
TimestampDescending
returns the newest data first and paginates when the MaxDatapoints
limit is reached. TimestampAscending
returns the oldest data first and paginates when the MaxDatapoints
limit is reached. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Period
to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. For better performance, specify StartTime
and EndTime
values that align with the value of the metric's Period
and sync up with the beginning and end of an hour. For example, if the Period
of a metric is 5 minutes, specifying 12:05 or 12:30 as StartTime
can get a faster response from CloudWatch than setting 12:07 or 12:29 as the StartTime
.This parameter is deprecated. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
StartTime
and EndTime
values that align with the value of the metric's Period
and sync up with the beginning and end of an hour. For example, if the Period
of a metric is 5 minutes, specifying 12:05 or 12:30 as EndTime
can get a faster response from CloudWatch than setting 12:07 or 12:29 as the EndTime
. Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Period
to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. For better performance, specify StartTime
and EndTime
values that align with the value of the metric's Period
and sync up with the beginning and end of an hour. For example, if the Period
of a metric is 5 minutes, specifying 12:05 or 12:30 as StartTime
can get a faster response from CloudWatch than setting 12:07 or 12:29 as the StartTime
. Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
AWS Tools for PowerShell: 2.x.y.z