Skip to content

Commit

Permalink
feat(client-cloudwatch): Adds support for additional statistics in Cl…
Browse files Browse the repository at this point in the history
…oudWatch Metric Streams.
  • Loading branch information
awstools committed Apr 13, 2022
1 parent 2f160df commit 58e3a94
Show file tree
Hide file tree
Showing 7 changed files with 467 additions and 29 deletions.
33 changes: 29 additions & 4 deletions clients/client-cloudwatch/src/CloudWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,13 +782,21 @@ export class CloudWatch extends CloudWatchClient {
}

/**
* <p>You can use the <code>GetMetricData</code> API to retrieve as many as 500 different
* <p>You can use the <code>GetMetricData</code> API to retrieve CloudWatch metric values. The operation
* can also include a CloudWatch Metrics Insights query, and one or more metric math functions.</p>
* <p>A <code>GetMetricData</code> 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 math expressions on the values of the returned statistics, to create
* 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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User
* Guide</i>.</p>
* Guide</i>.</p>
*
*
* <p>If you include a Metrics Insights query, each <code>GetMetricData</code> operation can include only one
* query. But the same <code>GetMetricData</code> 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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/query_with_cloudwatch-metrics-insights.html">Query your metrics with CloudWatch Metrics Insights</a>.</p>
*
* <p>Calls to the <code>GetMetricData</code> API have a different pricing structure than
* calls to <code>GetMetricStatistics</code>. For more information about pricing, see
Expand Down Expand Up @@ -818,6 +826,16 @@ export class CloudWatch extends CloudWatchClient {
* <p>If you omit <code>Unit</code> 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.</p>
*
* <p>
* <b>Using Metrics Insights queries with metric math</b>
* </p>
* <p>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 <b>GROUP BY</b> 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 <b>GROUP BY</b> 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. </p>
*/
public getMetricData(
args: GetMetricDataCommandInput,
Expand Down Expand Up @@ -1196,7 +1214,8 @@ export class CloudWatch extends CloudWatchClient {
* states of other alarms that you have created. The composite alarm goes into ALARM state
* only if all conditions of the rule are met.</p>
* <p>The alarms specified in a composite alarm's rule expression can include metric alarms
* and other composite alarms.</p>
* and other composite alarms. The rule expression of a composite alarm can include as many as 100 underlying alarms.
* Any single alarm can be included in the rule expressions of as many as 150 composite alarms.</p>
* <p>Using composite alarms can reduce
* alarm noise. You can create multiple metric alarms,
* and also create a composite alarm and
Expand Down Expand Up @@ -1536,6 +1555,12 @@ export class CloudWatch extends CloudWatchClient {
* </li>
* </ul>
*
* <p>By default, a metric stream always sends the <code>MAX</code>, <code>MIN</code>, <code>SUM</code>,
* and <code>SAMPLECOUNT</code> statistics for each metric that is streamed. You can use the
* <code>StatisticsConfigurations</code> parameter to have
* the metric stream also send extended statistics in the stream. Streaming extended statistics incurs
* additional costs. For more information, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>. </p>
*
* <p>When you use <code>PutMetricStream</code> to create a new metric stream, the stream
* is created in the <code>running</code> state. If you use it to update an existing stream,
* the state of the stream is not changed.</p>
Expand Down
24 changes: 21 additions & 3 deletions clients/client-cloudwatch/src/commands/GetMetricDataCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ export interface GetMetricDataCommandInput extends GetMetricDataInput {}
export interface GetMetricDataCommandOutput extends GetMetricDataOutput, __MetadataBearer {}

/**
* <p>You can use the <code>GetMetricData</code> API to retrieve as many as 500 different
* <p>You can use the <code>GetMetricData</code> API to retrieve CloudWatch metric values. The operation
* can also include a CloudWatch Metrics Insights query, and one or more metric math functions.</p>
* <p>A <code>GetMetricData</code> 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 math expressions on the values of the returned statistics, to create
* 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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User
* Guide</i>.</p>
* Guide</i>.</p>
*
*
* <p>If you include a Metrics Insights query, each <code>GetMetricData</code> operation can include only one
* query. But the same <code>GetMetricData</code> 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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/query_with_cloudwatch-metrics-insights.html">Query your metrics with CloudWatch Metrics Insights</a>.</p>
*
* <p>Calls to the <code>GetMetricData</code> API have a different pricing structure than
* calls to <code>GetMetricStatistics</code>. For more information about pricing, see
Expand Down Expand Up @@ -58,6 +66,16 @@ export interface GetMetricDataCommandOutput extends GetMetricDataOutput, __Metad
* <p>If you omit <code>Unit</code> 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.</p>
*
* <p>
* <b>Using Metrics Insights queries with metric math</b>
* </p>
* <p>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 <b>GROUP BY</b> 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 <b>GROUP BY</b> 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. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export interface PutCompositeAlarmCommandOutput extends __MetadataBearer {}
* states of other alarms that you have created. The composite alarm goes into ALARM state
* only if all conditions of the rule are met.</p>
* <p>The alarms specified in a composite alarm's rule expression can include metric alarms
* and other composite alarms.</p>
* and other composite alarms. The rule expression of a composite alarm can include as many as 100 underlying alarms.
* Any single alarm can be included in the rule expressions of as many as 150 composite alarms.</p>
* <p>Using composite alarms can reduce
* alarm noise. You can create multiple metric alarms,
* and also create a composite alarm and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ export interface PutMetricStreamCommandOutput extends PutMetricStreamOutput, __M
* </li>
* </ul>
*
* <p>By default, a metric stream always sends the <code>MAX</code>, <code>MIN</code>, <code>SUM</code>,
* and <code>SAMPLECOUNT</code> statistics for each metric that is streamed. You can use the
* <code>StatisticsConfigurations</code> parameter to have
* the metric stream also send extended statistics in the stream. Streaming extended statistics incurs
* additional costs. For more information, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>. </p>
*
* <p>When you use <code>PutMetricStream</code> to create a new metric stream, the stream
* is created in the <code>running</code> state. If you use it to update an existing stream,
* the state of the stream is not changed.</p>
Expand Down
Loading

0 comments on commit 58e3a94

Please sign in to comment.