id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
acw-ug-071 | acw-ug.pdf | 71 | • Firehose stream buffering options Interval of 60 seconds, size of 1 MB • Firehose stream retry option Duration of 60 seconds Statistics that can be streamed Metric streams always include the following statistics: Minimum, Maximum, SampleCount, and Sum. You can also choose to include the following additional statistics in a metric stream. This choice is on a per-metric basis. For more information about these statistics, see CloudWatch statistics definitions. • Percentile values such as p95 or p99 (For streams with either JSON or OpenTelemetry format) • Trimmed mean (Only for streams with the JSON format) • Winsorized mean (Only for streams with the JSON format) • Trimmed count (Only for streams with the JSON format) • Trimmed sum (Only for streams with the JSON format) • Percentile rank (Only for streams with the JSON format) Statistics that can be streamed 174 Amazon CloudWatch User Guide • Interquartile mean (Only for streams with the JSON format) Streaming additional statistics incurs additional charges. Streaming between one and five of these additional statistics for a particular metric is billed as an additional metric update. Thereafter, each additional set of up to five of these statistics is billed as another metric update. For example, suppose that for one metric you are streaming the following six additional statistics: p95, p99, p99.9, Trimmed mean, Winsorized mean, and Trimmed sum. Each update of this metric is billed as three metric updates: one for the metric update which includes the default statistics, one for the first five additional statistics, and one for the sixth additional statistic. Adding up to four more additional statistics for a total of ten would not increase the billing, but an eleventh additional statistic would do so. When you specify a metric name and namespace combination to stream additional statistics, all dimension combinations of that metric name and namespace are streamed with the additional statistics. CloudWatch metric streams publishes a new metric, TotalMetricUpdate, which reflects the base number of metric updates plus extra metric updates incurred by streaming additional statistics. For more information, see Monitoring your metric streams with CloudWatch metrics. For more information, see Amazon CloudWatch Pricing. Note Some metrics do not support percentiles. Percentile statistics for these metrics are excluded from the stream and do not incur metric stream charges. An example of these statistics that do not support percentiles are some metrics in the AWS/ECS namespace. The additional statistics that you configure are streamed only if they match the filters for the stream. For example, if you create a stream that has only EC2 and RDS in the include filters, and then your statistics configuration lists EC2 and Lambda, then the stream includes EC2 metrics with additional statistics, RDS metrics with only the default statistics, and doesn't include Lambda statistics at all. Metric stream operation and maintenance Metric streams are always in one of two states, Running or Stopped. Metric stream operation and maintenance 175 Amazon CloudWatch User Guide • Running— The metric stream is running correctly. There might not be any metric data streamed to the destination because of the filters on the stream. • Stopped— The metric stream has been explicitly stopped by someone, and not because of an error. It might be useful to stop your stream to temporarily pause the streaming of data without deleting the stream. If you stop and restart a metric stream, the metric data that was published to CloudWatch while the metric stream was stopped is not backfilled to the metric stream. If you change the output format of a metric stream, in certain cases you might see a small amount of metric data written to the destination in both the old format and the new format. To avoid this situation, you can create a new Firehose delivery stream with the same configuration as your current one, then change to the new Firehose delivery stream and change the output format at the same time. This way, the Kinesis records with different output format are stored on Amazon S3 in separate objects. Later, you can direct the traffic back to the original Firehose delivery stream and delete the second delivery stream. To view, edit, stop, and start your metric streams 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, Streams. The list of streams appears, and the Status column displays whether each stream is running or stopped. 3. 4. 5. To stop or start a metric stream, select the stream and choose Stop or Start. To see the details about a metric stream, select the stream and choose View details. To change the stream's output format, filters, destination Firehose stream, or roles, choose Edit and make the changes that you want. If you change the filters, there might be some gaps in the metric data during the transition. |
acw-ug-072 | acw-ug.pdf | 72 | CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, Streams. The list of streams appears, and the Status column displays whether each stream is running or stopped. 3. 4. 5. To stop or start a metric stream, select the stream and choose Stop or Start. To see the details about a metric stream, select the stream and choose View details. To change the stream's output format, filters, destination Firehose stream, or roles, choose Edit and make the changes that you want. If you change the filters, there might be some gaps in the metric data during the transition. Monitoring your metric streams with CloudWatch metrics Metric streams emit CloudWatch metrics about their health and operation in the AWS/ CloudWatch/MetricStreams namespace. The following metrics are emitted. These metrics are emitted with a MetricStreamName dimension and with no dimension. You can use the metrics Monitoring your metric streams 176 Amazon CloudWatch User Guide with no dimensions to see aggregated metrics for all of your metric streams. You can use the metrics with the MetricStreamName dimension to see the metrics about only that metric stream. For all of these metrics, values are emitted only for metric streams that are in the Running state. Metric Description MetricUpdate The number of metric updates sent to the metric stream. If no metric updates are streamed during a time period, this metric is not emitted during that time period. If you stop the metric stream, this metric stops being emitted until the metric stream is started again. Valid Statistic: Sum Units: None TotalMetr icUpdate This is calculated as MetricUpdate + a number based on additional statistics that are being streamed. For each unique namespace and metric name combination, streaming 1-5 additional statistics adds 1 to the TotalMetricUpdate , streaming 6-10 additional statistics adds 2 to TotalMetricUpdate , and so on. Valid Statistic: Sum Units: None PublishEr rorRate The number of unrecoverable errors that occur when putting data into the Firehose delivery stream. If no errors occur during a time period, this metric is not emitted during that time period. If you stop the metric stream, this metric stops being emitted until the metric stream is started again. Valid Statistic: Average to see the rate of metric updates unable to be written. This value will be between 0.0 and 1.0. Monitoring your metric streams 177 Amazon CloudWatch Metric Description Units: None User Guide Trust between CloudWatch and Firehose The Firehose delivery stream must trust CloudWatch through an IAM role that has write permissions to Firehose. These permissions can be limited to the single Firehose delivery stream that the CloudWatch metric stream uses. The IAM role must trust the streams.metrics.cloudwatch.amazonaws.com service principal. If you use the CloudWatch console to create a metric stream, you can have CloudWatch create the role with the correct permissions. If you use another method to create a metric stream, or you want to create the IAM role itself, it must contain the following permissions policy and trust policy. { "Version": "2012-10-17", "Statement": [ { "Action": [ "firehose:PutRecord", "firehose:PutRecordBatch" ], "Effect": "Allow", "Resource": "arn:aws:firehose:region:account-id:deliverystream/*" } ] } { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "streams.metrics.cloudwatch.amazonaws.com" }, "Action": "sts:AssumeRole" } ] Trust between CloudWatch and Firehose 178 Amazon CloudWatch } User Guide Metric data is streamed by CloudWatch to the destination Firehose delivery stream on behalf of the source that owns the metric stream resource. CloudWatch metric stream output in JSON format In a CloudWatch metric stream that uses the JSON format, each Firehose record contains multiple JSON objects separated by a newline character (\n). Each object includes a single data point of a single metric. The JSON format that is used is fully compatible with AWS Glue and with Amazon Athena. If you have a Firehose delivery stream and an AWS Glue table formatted correctly, the format can be automatically transformed into Parquet format or Optimized Row Columnar (ORC) format before being stored in S3. For more information about transforming the format, see Converting Your Input Record Format in Firehose. For more information about the correct format for AWS Glue, see Which AWS Glue schema should I use for JSON output format?. In the JSON format, the valid values for unit are the same as for the value of unit in the MetricDatum API structure. For more information, see MetricDatum. The value for the timestamp field is in epoch milliseconds, such as 1616004674229. The following is an example of the format. In this example, the JSON is formatted for easy reading, but in practice the whole format is on a single line. { "metric_stream_name": "MyMetricStream", "account_id": "1234567890", "region": "us-east-1", "namespace": "AWS/EC2", "metric_name": "DiskWriteOps", "dimensions": { "InstanceId": "i-123456789012" }, "timestamp": 1611929698000, "value": { "count": 3.0, "sum": 20.0, "max": 18.0, "min": 0.0, JSON output format 179 Amazon CloudWatch User Guide "p99": |
acw-ug-073 | acw-ug.pdf | 73 | for unit are the same as for the value of unit in the MetricDatum API structure. For more information, see MetricDatum. The value for the timestamp field is in epoch milliseconds, such as 1616004674229. The following is an example of the format. In this example, the JSON is formatted for easy reading, but in practice the whole format is on a single line. { "metric_stream_name": "MyMetricStream", "account_id": "1234567890", "region": "us-east-1", "namespace": "AWS/EC2", "metric_name": "DiskWriteOps", "dimensions": { "InstanceId": "i-123456789012" }, "timestamp": 1611929698000, "value": { "count": 3.0, "sum": 20.0, "max": 18.0, "min": 0.0, JSON output format 179 Amazon CloudWatch User Guide "p99": 17.56, "p99.9": 17.8764, "TM(25%:75%)": 16.43 }, "unit": "Seconds" } Which AWS Glue schema should I use for JSON output format? The following is an example of a JSON representation of the StorageDescriptor for an AWS Glue table, which would then be used by Firehose. For more information about StorageDescriptor, see StorageDescriptor. { "Columns": [ { "Name": "metric_stream_name", "Type": "string" }, { "Name": "account_id", "Type": "string" }, { "Name": "region", "Type": "string" }, { "Name": "namespace", "Type": "string" }, { "Name": "metric_name", "Type": "string" }, { "Name": "timestamp", "Type": "timestamp" }, { "Name": "dimensions", "Type": "map<string,string>" }, JSON output format 180 Amazon CloudWatch { "Name": "value", "Type": User Guide "struct<min:double,max:double,count:double,sum:double,p99:double,p99.9:double>" }, { "Name": "unit", "Type": "string" } ], "Location": "s3://amzn-s3-demo-bucket/", "InputFormat": "org.apache.hadoop.mapred.TextInputFormat", "OutputFormat": "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat", "SerdeInfo": { "SerializationLibrary": "org.apache.hive.hcatalog.data.JsonSerDe" }, "Parameters": { "classification": "json" } } The preceding example is for data written on Amazon S3 in JSON format. Replace the values in the following fields with the indicated values to store the data in Parquet format or Optimized Row Columnar (ORC) format. • Parquet: • inputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat • outputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat • SerDeInfo.serializationLib: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe • parameters.classification: parquet • ORC: • inputFormat: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat • outputFormat: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat • SerDeInfo.serializationLib: org.apache.hadoop.hive.ql.io.orc.OrcSerde • parameters.classification: orc JSON output format 181 Amazon CloudWatch User Guide CloudWatch metric stream output in OpenTelemetry 1.0.0 format Note With the OpenTelemetry 1.0.0 format, metric attributes are encoded as a list of KeyValue objects instead of the StringKeyValue type used in the 0.7.0 format. As a consumer, this is the only major change between the 0.7.0 and 1.0.0 formats. A parser generated from the 0.7.0 proto files won't parse metric attributes encoded in the 1.0.0 format. The same is true in reverse, a parser generated from the 1.0.0 proto files will not parse metric attributes encoded in the 0.7.0 format. OpenTelemetry is a collection of tools, APIs, and SDKs. You can use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis. OpenTelemetry is part of the Cloud Native Computing Foundation. For more information, see OpenTelemetry. For information about the full OpenTelemetry 1.0.0 specification, see Release version 1.0.0. A Kinesis record can contain one or more ExportMetricsServiceRequest OpenTelemetry data structures. Each data structure starts with a header with an UnsignedVarInt32 indicating the record length in bytes. Each ExportMetricsServiceRequest may contain data from multiple metrics at once. The following is a string representation of the message of the ExportMetricsServiceRequest OpenTelemetry data structure. OpenTelemetry serializes the Google Protocol Buffers binary protocol, and this is not human-readable. resource_metrics { resource { attributes { key: "cloud.provider" value { string_value: "aws" } } attributes { key: "cloud.account.id" value { string_value: "123456789012" } OpenTelemetry 1.0.0 output format 182 User Guide Amazon CloudWatch } attributes { key: "cloud.region" value { string_value: "us-east-1" } } attributes { key: "aws.exporter.arn" value { string_value: "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/ MyMetricStream" } } } scope_metrics { metrics { name: "amazonaws.com/AWS/DynamoDB/ConsumedReadCapacityUnits" unit: "NoneTranslated" summary { data_points { start_time_unix_nano: 60000000000 time_unix_nano: 120000000000 count: 1 sum: 1.0 quantile_values { value: 1.0 } quantile_values { quantile: 0.95 value: 1.0 } quantile_values { quantile: 0.99 value: 1.0 } quantile_values { quantile: 1.0 value: 1.0 } attributes { key: "Namespace" value { string_value: "AWS/DynamoDB" OpenTelemetry 1.0.0 output format 183 Amazon CloudWatch User Guide } } attributes { key: "MetricName" value { string_value: "ConsumedReadCapacityUnits" } } attributes { key: "Dimensions" value { kvlist_value { values { key: "TableName" value { string_value: "MyTable" } } } } } } data_points { start_time_unix_nano: 70000000000 time_unix_nano: 130000000000 count: 2 sum: 5.0 quantile_values { value: 2.0 } quantile_values { quantile: 1.0 value: 3.0 } attributes { key: "Namespace" value { string_value: "AWS/DynamoDB" } } attributes { key: "MetricName" value { string_value: "ConsumedReadCapacityUnits" OpenTelemetry 1.0.0 output format 184 Amazon CloudWatch User Guide } } attributes { key: "Dimensions" value { kvlist_value { values { key: "TableName" value { string_value: "MyTable" } } } } } } } } } } Top-level object to serialize OpenTelemetry metric data ExportMetricsServiceRequest is the top-level wrapper to serialize an OpenTelemetry exporter payload. It contains one or more ResourceMetrics. message ExportMetricsServiceRequest { // An array of ResourceMetrics. // For data coming from a single resource this array will typically contain one // element. Intermediary nodes (such as OpenTelemetry Collector) that |
acw-ug-074 | acw-ug.pdf | 74 | attributes { key: "MetricName" value { string_value: "ConsumedReadCapacityUnits" OpenTelemetry 1.0.0 output format 184 Amazon CloudWatch User Guide } } attributes { key: "Dimensions" value { kvlist_value { values { key: "TableName" value { string_value: "MyTable" } } } } } } } } } } Top-level object to serialize OpenTelemetry metric data ExportMetricsServiceRequest is the top-level wrapper to serialize an OpenTelemetry exporter payload. It contains one or more ResourceMetrics. message ExportMetricsServiceRequest { // An array of ResourceMetrics. // For data coming from a single resource this array will typically contain one // element. Intermediary nodes (such as OpenTelemetry Collector) that receive // data from multiple origins typically batch the data before forwarding further and // in that case this array will contain multiple elements. repeated opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; } ResourceMetrics is the top-level object to represent MetricData objects. // A collection of ScopeMetrics from a Resource. message ResourceMetrics { reserved 1000; // The resource for the metrics in this message. OpenTelemetry 1.0.0 output format 185 Amazon CloudWatch User Guide // If this field is not set then no resource info is known. opentelemetry.proto.resource.v1.Resource resource = 1; // A list of metrics that originate from a resource. repeated ScopeMetrics scope_metrics = 2; // This schema_url applies to the data in the "resource" field. It does not apply // to the data in the "scope_metrics" field which have their own schema_url field. string schema_url = 3; } The Resource object A Resource object is a value-pair object that contains some information about the resource that generated the metrics. For metrics created by AWS, the data structure contains the Amazon Resource Name (ARN) of the resource related to the metric, such as an EC2 instance or an S3 bucket. The Resource object contains an attribute called attributes, which store a list of key-value pairs. • cloud.account.id contains the account ID • cloud.region contains the Region • aws.exporter.arn contains the metric stream ARN • cloud.provider is always aws. // Resource information. message Resource { // Set of attributes that describe the resource. // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). repeated opentelemetry.proto.common.v1.KeyValue attributes = 1; // dropped_attributes_count is the number of dropped attributes. If the value is 0, then // no attributes were dropped. uint32 dropped_attributes_count = 2; } The ScopeMetrics object OpenTelemetry 1.0.0 output format 186 Amazon CloudWatch User Guide The scope field will not be filled. We fill only the metrics field that we are exporting. // A collection of Metrics produced by an Scope. message ScopeMetrics { // The instrumentation scope information for the metrics in this message. // Semantically when InstrumentationScope isn't set, it is equivalent with // an empty instrumentation scope name (unknown). opentelemetry.proto.common.v1.InstrumentationScope scope = 1; // A list of metrics that originate from an instrumentation library. repeated Metric metrics = 2; // This schema_url applies to all metrics in the "metrics" field. string schema_url = 3; } The Metric object The metric object contains some metadata and a Summary data field that contains a list of SummaryDataPoint. For metric streams, the metadata is as follows: • name will be amazonaws.com/metric_namespace/metric_name • description will be blank • unit will be filled by mapping the metric datum's unit to the case-sensitive variant of the Unified code for Units of Measure. For more information, see Translations with OpenTelemetry 1.0.0 format in CloudWatch and The Unified Code For Units of Measure. • type will be SUMMARY message Metric { reserved 4, 6, 8; // name of the metric, including its DNS name prefix. It must be unique. string name = 1; // description of the metric, which can be used in documentation. string description = 2; // unit in which the metric value is reported. Follows the format OpenTelemetry 1.0.0 output format 187 Amazon CloudWatch User Guide // described by http://unitsofmeasure.org/ucum.html. string unit = 3; // Data determines the aggregation type (if any) of the metric, what is the // reported value type for the data points, as well as the relatationship to // the time interval over which they are reported. oneof data { Gauge gauge = 5; Sum sum = 7; Histogram histogram = 9; ExponentialHistogram exponential_histogram = 10; Summary summary = 11; } } message Summary { repeated SummaryDataPoint data_points = 1; } The SummaryDataPoint object The SummaryDataPoint object contains the value of a single data point in a time series in a DoubleSummary metric. // SummaryDataPoint is a single data point in a timeseries that describes the // time-varying values of a Summary metric. message SummaryDataPoint { reserved 1; // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). // Attribute keys MUST be unique (it is |
acw-ug-075 | acw-ug.pdf | 75 | ExponentialHistogram exponential_histogram = 10; Summary summary = 11; } } message Summary { repeated SummaryDataPoint data_points = 1; } The SummaryDataPoint object The SummaryDataPoint object contains the value of a single data point in a time series in a DoubleSummary metric. // SummaryDataPoint is a single data point in a timeseries that describes the // time-varying values of a Summary metric. message SummaryDataPoint { reserved 1; // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). // Attribute keys MUST be unique (it is not allowed to have more than one // attribute with the same key). repeated opentelemetry.proto.common.v1.KeyValue attributes = 7; // StartTimeUnixNano is optional but strongly encouraged, see the // the detailed comments above Metric. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. fixed64 start_time_unix_nano = 2; // TimeUnixNano is required, see the detailed comments above Metric. OpenTelemetry 1.0.0 output format 188 Amazon CloudWatch // User Guide // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. fixed64 time_unix_nano = 3; // count is the number of values in the population. Must be non-negative. fixed64 count = 4; // sum of the values in the population. If count is zero then this field // must be zero. // // Note: Sum should only be filled out when measuring non-negative discrete // events, and is assumed to be monotonic over the values of these events. // Negative events *can* be recorded, but sum should not be filled out when // doing so. This is specifically to enforce compatibility w/ OpenMetrics, // see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/ OpenMetrics.md#summary double sum = 5; // Represents the value at a given quantile of a distribution. // // To record Min and Max values following conventions are used: // - The 1.0 quantile is equivalent to the maximum value observed. // - The 0.0 quantile is equivalent to the minimum value observed. // // See the following issue for more context: // https://github.com/open-telemetry/opentelemetry-proto/issues/125 message ValueAtQuantile { // The quantile of a distribution. Must be in the interval // [0.0, 1.0]. double quantile = 1; // The value at the given quantile of a distribution. // // Quantile values must NOT be negative. double value = 2; } // (Optional) list of values at different quantiles of the distribution calculated // from the current snapshot. The quantiles must be strictly increasing. repeated ValueAtQuantile quantile_values = 6; // Flags that apply to this specific data point. See DataPointFlags // for the available flags and their meaning. OpenTelemetry 1.0.0 output format 189 Amazon CloudWatch uint32 flags = 8; } User Guide For more information, see Translations with OpenTelemetry 1.0.0 format in CloudWatch. Translations with OpenTelemetry 1.0.0 format in CloudWatch CloudWatch performs some transformations to put CloudWatch data into OpenTelemetry format. Translating namespace, metric name, and dimensions These attributes are key-value pairs encoded in the mapping. • One attribute has the key Namespace and its value is the namespace of the metric • One attribute has the key MetricName and its value is the name of the metric • One pair has the key Dimensions and its value is a nested list of key-value pairs. Each pair in this list maps to a CloudWatch metric dimension, where the pair's key is the name of the dimension and its value is the value of the dimension. Translating Average, Sum, SampleCount, Min and Max The Summary datapoint enables CloudWatch to export all of these statistics using one datapoint. • startTimeUnixNano contains the CloudWatch startTime • timeUnixNano contains the CloudWatch endTime • sum contains the Sum statistic. • count contains the SampleCount statistic. • quantile_values contains two valueAtQuantile.value objects: • valueAtQuantile.quantile = 0.0 with valueAtQuantile.value = Min value • valueAtQuantile.quantile = 0.99 with valueAtQuantile.value = p99 value • valueAtQuantile.quantile = 0.999 with valueAtQuantile.value = p99.9 value • valueAtQuantile.quantile = 1.0 with valueAtQuantile.value = Max value Resources that consume the metric stream can calculate the Average statistic as Sum/ SampleCount. OpenTelemetry 1.0.0 output format 190 Amazon CloudWatch Translating units User Guide CloudWatch units are mapped to the case-sensitive variant of the Unified code for Units of Measure, as shown in the following table. For more information, see The Unified Code For Units of Measure. CloudWatch Second Second or Seconds Microseconds Milliseconds Bytes Kilobytes Megabytes Gigabytes Terabytes Bits Kilobits Megabits Gigabits Terabits Percent Count None OpenTelemetry s s us ms By kBy MBy GBy TBy bit kbit MBit GBit Tbit % {Count} 1 OpenTelemetry 1.0.0 output format 191 Amazon CloudWatch User Guide Units that are combined with a slash are mapped by applying the OpenTelemetry conversion of both the units. For example, Bytes/Second is mapped to By/s. How to parse OpenTelemetry 1.0.0 messages This |
acw-ug-076 | acw-ug.pdf | 76 | for Units of Measure, as shown in the following table. For more information, see The Unified Code For Units of Measure. CloudWatch Second Second or Seconds Microseconds Milliseconds Bytes Kilobytes Megabytes Gigabytes Terabytes Bits Kilobits Megabits Gigabits Terabits Percent Count None OpenTelemetry s s us ms By kBy MBy GBy TBy bit kbit MBit GBit Tbit % {Count} 1 OpenTelemetry 1.0.0 output format 191 Amazon CloudWatch User Guide Units that are combined with a slash are mapped by applying the OpenTelemetry conversion of both the units. For example, Bytes/Second is mapped to By/s. How to parse OpenTelemetry 1.0.0 messages This section provides information to help you get started with parsing OpenTelemetry 1.0.0. First, you should get language-specific bindings, which enable you to parse OpenTelemetry 1.0.0 messages in your preferred language. To get language-specific bindings • The steps depend on your preferred language. • • To use Java, add the following Maven dependency to your Java project: OpenTelemetry Java >> 0.14.1. To use any other language, follow these steps: a. Make sure that your language is supported by checking the list at Generating Your Classes. b. Install the Protobuf compiler by following the steps at Download Protocol Buffers. c. Download the OpenTelemetry 1.0.0 ProtoBuf definitions at Release version 1.0.0. d. Confirm that you are in the root folder of the downloaded OpenTelemetry 1.0.0 ProtoBuf definitions. Then create a src folder and then run the command to generate language-specific bindings. For more information, see Generating Your Classes. The following is an example for how to generate Javascript bindings. protoc --proto_path=./ --js_out=import_style=commonjs,binary:src \ opentelemetry/proto/common/v1/common.proto \ opentelemetry/proto/resource/v1/resource.proto \ opentelemetry/proto/metrics/v1/metrics.proto \ opentelemetry/proto/collector/metrics/v1/metrics_service.proto The following section includes examples of using the language-specific bindings that you can build using the previous instructions. Java OpenTelemetry 1.0.0 output format 192 Amazon CloudWatch package com.example; User Guide import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; public class MyOpenTelemetryParser { public List<ExportMetricsServiceRequest> parse(InputStream inputStream) throws IOException { List<ExportMetricsServiceRequest> result = new ArrayList<>(); ExportMetricsServiceRequest request; /* A Kinesis record can contain multiple `ExportMetricsServiceRequest` records, each of them starting with a header with an UnsignedVarInt32 indicating the record length in bytes: ------ --------------------------- ------ ----------------------- |UINT32|ExportMetricsServiceRequest|UINT32|ExportMetricsService... ------ --------------------------- ------ ----------------------- */ while ((request = ExportMetricsServiceRequest.parseDelimitedFrom(inputStream)) != null) { // Do whatever we want with the parsed message result.add(request); } return result; } } Javascript This example assumes that the root folder with the bindings generated is ./ The data argument of the function parseRecord can be one of the following types: • Uint8Array this is optimal • Buffer optimal under node • Array.number 8-bit integers OpenTelemetry 1.0.0 output format 193 Amazon CloudWatch User Guide const pb = require('google-protobuf') const pbMetrics = require('./opentelemetry/proto/collector/metrics/v1/metrics_service_pb') function parseRecord(data) { const result = [] // Loop until we've read all the data from the buffer while (data.length) { /* A Kinesis record can contain multiple `ExportMetricsServiceRequest` records, each of them starting with a header with an UnsignedVarInt32 indicating the record length in bytes: ------ --------------------------- ------ ----------------------- |UINT32|ExportMetricsServiceRequest|UINT32|ExportMetricsService... ------ --------------------------- ------ ----------------------- */ const reader = new pb.BinaryReader(data) const messageLength = reader.decoder_.readUnsignedVarint32() const messageFrom = reader.decoder_.cursor_ const messageTo = messageFrom + messageLength // Extract the current `ExportMetricsServiceRequest` message to parse const message = data.subarray(messageFrom, messageTo) // Parse the current message using the ProtoBuf library const parsed = pbMetrics.ExportMetricsServiceRequest.deserializeBinary(message) // Do whatever we want with the parsed message result.push(parsed.toObject()) // Shrink the remaining buffer, removing the already parsed data data = data.subarray(messageTo) } return result } Python You must read the var-int delimiters yourself or use the internal methods _VarintBytes(size) and _DecodeVarint32(buffer, position). These return the position OpenTelemetry 1.0.0 output format 194 Amazon CloudWatch User Guide in the buffer just after the size bytes. The read-side constructs a new buffer that is limited to reading only the bytes of the message. size = my_metric.ByteSize() f.write(_VarintBytes(size)) f.write(my_metric.SerializeToString()) msg_len, new_pos = _DecodeVarint32(buf, 0) msg_buf = buf[new_pos:new_pos+msg_len] request = metrics_service_pb.ExportMetricsServiceRequest() request.ParseFromString(msg_buf) Go Use Buffer.DecodeMessage(). C# Use CodedInputStream. This class can read size-delimited messages. C++ The functions described in google/protobuf/util/delimited_message_util.h can read size-delimited messages. Other languages For other languages, see Download Protocol Buffers. When implementing the parser, consider that a Kinesis record can contain multiple ExportMetricsServiceRequest Protocol Buffers messages, each of them starting with a header with an UnsignedVarInt32 that indicates the record length in bytes. CloudWatch metric stream output in OpenTelemetry 0.7.0 format OpenTelemetry is a collection of tools, APIs, and SDKs. You can use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis. OpenTelemetry is part of the Cloud Native Computing Foundation. For more information, see OpenTelemetry. For information about the full OpenTelemetry 0.7.0 specification, see v0.7.0 release. A Kinesis record can contain one or more ExportMetricsServiceRequest OpenTelemetry data structures. Each data structure starts with a header with an UnsignedVarInt32 indicating the OpenTelemetry 0.7.0 output format 195 Amazon CloudWatch User Guide record length |
acw-ug-077 | acw-ug.pdf | 77 | the record length in bytes. CloudWatch metric stream output in OpenTelemetry 0.7.0 format OpenTelemetry is a collection of tools, APIs, and SDKs. You can use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis. OpenTelemetry is part of the Cloud Native Computing Foundation. For more information, see OpenTelemetry. For information about the full OpenTelemetry 0.7.0 specification, see v0.7.0 release. A Kinesis record can contain one or more ExportMetricsServiceRequest OpenTelemetry data structures. Each data structure starts with a header with an UnsignedVarInt32 indicating the OpenTelemetry 0.7.0 output format 195 Amazon CloudWatch User Guide record length in bytes. Each ExportMetricsServiceRequest may contain data from multiple metrics at once. The following is a string representation of the message of the ExportMetricsServiceRequest OpenTelemetry data structure. OpenTelemetry serializes the Google Protocol Buffers binary protocol, and this is not human-readable. resource_metrics { resource { attributes { key: "cloud.provider" value { string_value: "aws" } } attributes { key: "cloud.account.id" value { string_value: "2345678901" } } attributes { key: "cloud.region" value { string_value: "us-east-1" } } attributes { key: "aws.exporter.arn" value { string_value: "arn:aws:cloudwatch:us-east-1:123456789012:metric-stream/ MyMetricStream" } } } instrumentation_library_metrics { metrics { name: "amazonaws.com/AWS/DynamoDB/ConsumedReadCapacityUnits" unit: "1" double_summary { data_points { labels { key: "Namespace" OpenTelemetry 0.7.0 output format 196 Amazon CloudWatch User Guide value: "AWS/DynamoDB" } labels { key: "MetricName" value: "ConsumedReadCapacityUnits" } labels { key: "TableName" value: "MyTable" } start_time_unix_nano: 1604948400000000000 time_unix_nano: 1604948460000000000 count: 1 sum: 1.0 quantile_values { quantile: 0.0 value: 1.0 } quantile_values { quantile: 0.95 value: 1.0 } quantile_values { quantile: 0.99 value: 1.0 } quantile_values { quantile: 1.0 value: 1.0 } } data_points { labels { key: "Namespace" value: "AWS/DynamoDB" } labels { key: "MetricName" value: "ConsumedReadCapacityUnits" } labels { key: "TableName" value: "MyTable" } OpenTelemetry 0.7.0 output format 197 Amazon CloudWatch User Guide start_time_unix_nano: 1604948460000000000 time_unix_nano: 1604948520000000000 count: 2 sum: 5.0 quantile_values { quantile: 0.0 value: 2.0 } quantile_values { quantile: 1.0 value: 3.0 } } } } } } Top-level object to serialize OpenTelemetry metric data ExportMetricsServiceRequest is the top-level wrapper to serialize an OpenTelemetry exporter payload. It contains one or more ResourceMetrics. message ExportMetricsServiceRequest { // An array of ResourceMetrics. // For data coming from a single resource this array will typically contain one // element. Intermediary nodes (such as OpenTelemetry Collector) that receive // data from multiple origins typically batch the data before forwarding further and // in that case this array will contain multiple elements. repeated opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1; } ResourceMetrics is the top-level object to represent MetricData objects. // A collection of InstrumentationLibraryMetrics from a Resource. message ResourceMetrics { // The resource for the metrics in this message. // If this field is not set then no resource info is known. opentelemetry.proto.resource.v1.Resource resource = 1; // A list of metrics that originate from a resource. repeated InstrumentationLibraryMetrics instrumentation_library_metrics = 2; OpenTelemetry 0.7.0 output format 198 Amazon CloudWatch } The Resource object User Guide A Resource object is a value-pair object that contains some information about the resource that generated the metrics. For metrics created by AWS, the data structure contains the Amazon Resource Name (ARN) of the resource related to the metric, such as an EC2 instance or an S3 bucket. The Resource object contains an attribute called attributes, which store a list of key-value pairs. • cloud.account.id contains the account ID • cloud.region contains the Region • aws.exporter.arn contains the metric stream ARN • cloud.provider is always aws. // Resource information. message Resource { // Set of labels that describe the resource. repeated opentelemetry.proto.common.v1.KeyValue attributes = 1; // dropped_attributes_count is the number of dropped attributes. If the value is 0, // no attributes were dropped. uint32 dropped_attributes_count = 2; } The InstrumentationLibraryMetrics object The instrumentation_library field will not be filled. We will fill only the metrics field that we are exporting. // A collection of Metrics produced by an InstrumentationLibrary. message InstrumentationLibraryMetrics { // The instrumentation library information for the metrics in this message. // If this field is not set then no library info is known. opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; // A list of metrics that originate from an instrumentation library. repeated Metric metrics = 2; OpenTelemetry 0.7.0 output format 199 Amazon CloudWatch } The Metric object User Guide The metric object contains a DoubleSummary data field that contains a list of DoubleSummaryDataPoint. message Metric { // name of the metric, including its DNS name prefix. It must be unique. string name = 1; // description of the metric, which can be used in documentation. string description = 2; // unit in which the metric value is reported. Follows the format // described by http://unitsofmeasure.org/ucum.html. string unit = 3; oneof data { IntGauge int_gauge = 4; DoubleGauge double_gauge = 5; IntSum int_sum = 6; DoubleSum double_sum = 7; IntHistogram int_histogram = 8; DoubleHistogram double_histogram = 9; DoubleSummary double_summary |
acw-ug-078 | acw-ug.pdf | 78 | Guide The metric object contains a DoubleSummary data field that contains a list of DoubleSummaryDataPoint. message Metric { // name of the metric, including its DNS name prefix. It must be unique. string name = 1; // description of the metric, which can be used in documentation. string description = 2; // unit in which the metric value is reported. Follows the format // described by http://unitsofmeasure.org/ucum.html. string unit = 3; oneof data { IntGauge int_gauge = 4; DoubleGauge double_gauge = 5; IntSum int_sum = 6; DoubleSum double_sum = 7; IntHistogram int_histogram = 8; DoubleHistogram double_histogram = 9; DoubleSummary double_summary = 11; } } message DoubleSummary { repeated DoubleSummaryDataPoint data_points = 1; } The MetricDescriptor object The MetricDescriptor object contains metadata. For more information, see metrics.proto on GitHub. For metric streams, the MetricDescriptor has the following contents: • name will be amazonaws.com/metric_namespace/metric_name • description will be blank. OpenTelemetry 0.7.0 output format 200 Amazon CloudWatch User Guide • unit will be filled by mapping the metric datum's unit to the case-sensitive variant of the Unified code for Units of Measure. For more information, see Translations with OpenTelemetry 0.7.0 format in CloudWatch and The Unified Code For Units of Measure. • type will be SUMMARY. The DoubleSummaryDataPoint object The DoubleSummaryDataPoint object contains the value of a single data point in a time series in a DoubleSummary metric. // DoubleSummaryDataPoint is a single data point in a timeseries that describes the // time-varying values of a Summary metric. message DoubleSummaryDataPoint { // The set of labels that uniquely identify this timeseries. repeated opentelemetry.proto.common.v1.StringKeyValue labels = 1; // start_time_unix_nano is the last time when the aggregation value was reset // to "zero". For some metric types this is ignored, see data types for more // details. // // The aggregation value is over the time interval (start_time_unix_nano, // time_unix_nano]. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. // // Value of 0 indicates that the timestamp is unspecified. In that case the // timestamp may be decided by the backend. fixed64 start_time_unix_nano = 2; // time_unix_nano is the moment when this aggregation value was reported. // // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January // 1970. fixed64 time_unix_nano = 3; // count is the number of values in the population. Must be non-negative. fixed64 count = 4; // sum of the values in the population. If count is zero then this field // must be zero. double sum = 5; OpenTelemetry 0.7.0 output format 201 Amazon CloudWatch User Guide // Represents the value at a given quantile of a distribution. // // To record Min and Max values following conventions are used: // - The 1.0 quantile is equivalent to the maximum value observed. // - The 0.0 quantile is equivalent to the minimum value observed. message ValueAtQuantile { // The quantile of a distribution. Must be in the interval // [0.0, 1.0]. double quantile = 1; // The value at the given quantile of a distribution. double value = 2; } // (Optional) list of values at different quantiles of the distribution calculated // from the current snapshot. The quantiles must be strictly increasing. repeated ValueAtQuantile quantile_values = 6; } For more information, see Translations with OpenTelemetry 0.7.0 format in CloudWatch. Translations with OpenTelemetry 0.7.0 format in CloudWatch CloudWatch performs some transformations to put CloudWatch data into OpenTelemetry format. Translating namespace, metric name, and dimensions These attributes are key-value pairs encoded in the mapping. • One pair contains the namespace of the metric • One pair contains the name of the metric • For each dimension, CloudWatch stores the following pair: metricDatum.Dimensions[i].Name, metricDatum.Dimensions[i].Value Translating Average, Sum, SampleCount, Min and Max The Summary datapoint enables CloudWatch to export all of these statistics using one datapoint. • startTimeUnixNano contains the CloudWatch startTime • timeUnixNano contains the CloudWatch endTime OpenTelemetry 0.7.0 output format 202 Amazon CloudWatch • sum contains the Sum statistic. • count contains the SampleCount statistic. User Guide • quantile_values contains two valueAtQuantile.value objects: • valueAtQuantile.quantile = 0.0 with valueAtQuantile.value = Min value • valueAtQuantile.quantile = 0.99 with valueAtQuantile.value = p99 value • valueAtQuantile.quantile = 0.999 with valueAtQuantile.value = p99.9 value • valueAtQuantile.quantile = 1.0 with valueAtQuantile.value = Max value Resources that consume the metric stream can calculate the Average statistic as Sum/ SampleCount. Translating units CloudWatch units are mapped to the case-sensitive variant of the Unified code for Units of Measure, as shown in the following table. For more information, see The Unified Code For Units of Measure. CloudWatch Second Second or Seconds Microsecond Milliseconds Bytes Kilobytes Megabytes Gigabytes Terabytes Bits OpenTelemetry s s us ms By kBy MBy GBy TBy bit OpenTelemetry 0.7.0 output format 203 Amazon CloudWatch CloudWatch Kilobits Megabits Gigabits Terabits Percent Count None User |
acw-ug-079 | acw-ug.pdf | 79 | p99.9 value • valueAtQuantile.quantile = 1.0 with valueAtQuantile.value = Max value Resources that consume the metric stream can calculate the Average statistic as Sum/ SampleCount. Translating units CloudWatch units are mapped to the case-sensitive variant of the Unified code for Units of Measure, as shown in the following table. For more information, see The Unified Code For Units of Measure. CloudWatch Second Second or Seconds Microsecond Milliseconds Bytes Kilobytes Megabytes Gigabytes Terabytes Bits OpenTelemetry s s us ms By kBy MBy GBy TBy bit OpenTelemetry 0.7.0 output format 203 Amazon CloudWatch CloudWatch Kilobits Megabits Gigabits Terabits Percent Count None User Guide OpenTelemetry kbit MBit GBit Tbit % {Count} 1 Units that are combined with a slash are mapped by applying the OpenTelemetry conversion of both the units. For example, Bytes/Second is mapped to By/s. How to parse OpenTelemetry 0.7.0 messages This section provides information to help you get started with parsing OpenTelemetry 0.7.0. First, you should get language-specific bindings, which enable you to parse OpenTelemetry 0.7.0 messages in your preferred language. To get language-specific bindings • The steps depend on your preferred language. • • To use Java, add the following Maven dependency to your Java project: OpenTelemetry Java >> 0.14.1. To use any other language, follow these steps: a. Make sure that your language is supported by checking the list at Generating Your Classes. b. Install the Protobuf compiler by following the steps at Download Protocol Buffers. c. Download the OpenTelemetry 0.7.0 ProtoBuf definitions at v0.7.0 release. d. Confirm that you are in the root folder of the downloaded OpenTelemetry 0.7.0 ProtoBuf definitions. Then create a src folder and then run the command to OpenTelemetry 0.7.0 output format 204 Amazon CloudWatch User Guide generate language-specific bindings. For more information, see Generating Your Classes. The following is an example for how to generate Javascript bindings. protoc --proto_path=./ --js_out=import_style=commonjs,binary:src \ opentelemetry/proto/common/v1/common.proto \ opentelemetry/proto/resource/v1/resource.proto \ opentelemetry/proto/metrics/v1/metrics.proto \ opentelemetry/proto/collector/metrics/v1/metrics_service.proto The following section includes examples of using the language-specific bindings that you can build using the previous instructions. Java package com.example; import io.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; public class MyOpenTelemetryParser { public List<ExportMetricsServiceRequest> parse(InputStream inputStream) throws IOException { List<ExportMetricsServiceRequest> result = new ArrayList<>(); ExportMetricsServiceRequest request; /* A Kinesis record can contain multiple `ExportMetricsServiceRequest` records, each of them starting with a header with an UnsignedVarInt32 indicating the record length in bytes: ------ --------------------------- ------ ----------------------- |UINT32|ExportMetricsServiceRequest|UINT32|pExportMetricsService... ------ --------------------------- ------ ----------------------- */ while ((request = ExportMetricsServiceRequest.parseDelimitedFrom(inputStream)) != null) { // Do whatever we want with the parsed message OpenTelemetry 0.7.0 output format 205 Amazon CloudWatch User Guide result.add(request); } return result; } } Javascript This example assumes that the root folder with the bindings generated is ./ The data argument of the function parseRecord can be one of the following types: • Uint8Array this is optimal • Buffer optimal under node • Array.number 8-bit integers const pb = require('google-protobuf') const pbMetrics = require('./opentelemetry/proto/collector/metrics/v1/metrics_service_pb') function parseRecord(data) { const result = [] // Loop until we've read all the data from the buffer while (data.length) { /* A Kinesis record can contain multiple `ExportMetricsServiceRequest` records, each of them starting with a header with an UnsignedVarInt32 indicating the record length in bytes: ------ --------------------------- ------ ----------------------- |UINT32|ExportMetricsServiceRequest|UINT32|ExportMetricsService... ------ --------------------------- ------ ----------------------- */ const reader = new pb.BinaryReader(data) const messageLength = reader.decoder_.readUnsignedVarint32() const messageFrom = reader.decoder_.cursor_ const messageTo = messageFrom + messageLength // Extract the current `ExportMetricsServiceRequest` message to parse const message = data.subarray(messageFrom, messageTo) // Parse the current message using the ProtoBuf library OpenTelemetry 0.7.0 output format 206 Amazon CloudWatch const parsed = User Guide pbMetrics.ExportMetricsServiceRequest.deserializeBinary(message) // Do whatever we want with the parsed message result.push(parsed.toObject()) // Shrink the remaining buffer, removing the already parsed data data = data.subarray(messageTo) } return result } Python You must read the var-int delimiters yourself or use the internal methods _VarintBytes(size) and _DecodeVarint32(buffer, position). These return the position in the buffer just after the size bytes. The read-side constructs a new buffer that is limited to reading only the bytes of the message. size = my_metric.ByteSize() f.write(_VarintBytes(size)) f.write(my_metric.SerializeToString()) msg_len, new_pos = _DecodeVarint32(buf, 0) msg_buf = buf[new_pos:new_pos+msg_len] request = metrics_service_pb.ExportMetricsServiceRequest() request.ParseFromString(msg_buf) Go Use Buffer.DecodeMessage(). C# Use CodedInputStream. This class can read size-delimited messages. C++ The functions described in google/protobuf/util/delimited_message_util.h can read size-delimited messages. Other languages OpenTelemetry 0.7.0 output format 207 Amazon CloudWatch User Guide For other languages, see Download Protocol Buffers. When implementing the parser, consider that a Kinesis record can contain multiple ExportMetricsServiceRequest Protocol Buffers messages, each of them starting with a header with an UnsignedVarInt32 that indicates the record length in bytes. Troubleshooting metric streams in CloudWatch If you're not seeing metric data at your final destination, check the following: • Check that the metric stream is in the running state. For steps on how to use the CloudWatch console to do this, see Metric stream operation and |
acw-ug-080 | acw-ug.pdf | 80 | read size-delimited messages. Other languages OpenTelemetry 0.7.0 output format 207 Amazon CloudWatch User Guide For other languages, see Download Protocol Buffers. When implementing the parser, consider that a Kinesis record can contain multiple ExportMetricsServiceRequest Protocol Buffers messages, each of them starting with a header with an UnsignedVarInt32 that indicates the record length in bytes. Troubleshooting metric streams in CloudWatch If you're not seeing metric data at your final destination, check the following: • Check that the metric stream is in the running state. For steps on how to use the CloudWatch console to do this, see Metric stream operation and maintenance. • Metrics published more than two days in the past are not streamed. To determine whether a particular metric will be streamed, graph the metric in the CloudWatch console and check how old the last visible datapoint is. If it is more than two days in the past, then it won't be picked up by metric streams. • Check the metrics emitted by the metric stream. In the CloudWatch console, under Metrics, look at the AWS/CloudWatch/MetricStreams namespace for the MetricUpdate, TotalMetricUpdate, and PublishErrorRate metrics. • If the PublishErrorRate metric is high, confirm that the destination that is used by the Firehose delivery stream exists and that the IAM role specified in the metric stream's configuration grants the CloudWatch service principal permissions to write to it. For more information, see Trust between CloudWatch and Firehose. • Check that the Firehose delivery stream has permission to write to the final destination. • In the Firehose console, view the Firehose delivery stream that is used for the metric stream and check the Monitoring tab to see whether the Firehose delivery stream is receiving data. • Confirm that you have configured your Firehose delivery stream with the correct details. • Check any available logs or metrics for the final destination that the Firehose delivery stream writes to. • To get more detailed information, enable CloudWatch Logs error logging on the Firehose delivery stream. For more information, see Monitoring Amazon Data Firehose Using CloudWatch Logs. Troubleshooting metric streams in CloudWatch 208 Amazon CloudWatch Note User Guide After a data point for a specific metric and timestamp has been sent, it won’t be sent again even if the value of the data point changes later. View available metrics Metrics are grouped first by namespace, and then by the various dimension combinations within each namespace. For example, you can view all EC2 metrics, EC2 metrics grouped by instance, or EC2 metrics grouped by Auto Scaling group. Only the AWS services that you're using send metrics to Amazon CloudWatch. For a list of AWS services that send metrics to CloudWatch, see AWS services that publish CloudWatch metrics. From this page, you can also see the metrics and dimensions that are published by each of those services. Note Metrics that have not had any new data points in the past two weeks do not appear in the console. They also do not appear when you type their metric name or dimension names in the search box in the All metrics tab in the console, and they are not returned in the results of a list-metrics command. The best way to retrieve these metrics is with the get-metric- data or get-metric-statistics commands in the AWS CLI. If the old metric you want to view has a current metric with similar dimensions, you can view that current similar metric and then choose the Source tab, and change the metric name and dimension fields to the ones that you want, and also change the time range to a time when the metric was being reported. The following steps help you browse through the metric namespaces to find and view metrics. You can also search for metrics using targeted search terms. For more information, see Search for available metrics. If you are browsing in an account set up as a monitoring account in CloudWatch cross-account observability, you can view metrics from the source accounts linked to this monitoring account. When metrics from source accounts are displayed, the ID or label of the account that they are from is also displayed. For more information, see CloudWatch cross-account observability. View available metrics 209 Amazon CloudWatch User Guide To view available metrics by namespace and dimension using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. 5. In the navigation pane, choose Metrics, All metrics. Select a metric namespace (for example, EC2 or Lambda). Select a metric dimension (for example, Per-Instance Metrics or By Function Name). The Browse tab displays all metrics for that dimension in the namespace. By each metric name is an information button you can choose to see a pop-up with the metric definition. If this is a monitoring account in CloudWatch cross-account observability, you also see the metrics |
acw-ug-081 | acw-ug.pdf | 81 | CloudWatch User Guide To view available metrics by namespace and dimension using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. 5. In the navigation pane, choose Metrics, All metrics. Select a metric namespace (for example, EC2 or Lambda). Select a metric dimension (for example, Per-Instance Metrics or By Function Name). The Browse tab displays all metrics for that dimension in the namespace. By each metric name is an information button you can choose to see a pop-up with the metric definition. If this is a monitoring account in CloudWatch cross-account observability, you also see the metrics from the source accounts linked to this monitoring account. The Account label and Account id columns in the table display which account each metric is from. You can do the following: a. b. c. d. e. To sort the table, use the column heading. To graph a metric, select the check box next to the metric. To select all metrics, select the check box in the heading row of the table. To filter by account, choose the account label or account ID and then choose Add to search. To filter by resource, choose the resource ID and then choose Add to search. To filter by metric, choose the metric name and then choose Add to search. 6. (Optional) To add this graph to a CloudWatch dashboard, choose Actions, Add to dashboard. To view available metrics by account namespace, dimension, or metric using the AWS CLI Use the list-metrics command to list CloudWatch metrics. For a list of the namespaces, metrics, and dimensions for all services that publish metrics, see AWS services that publish CloudWatch metrics. The following example command lists all the metrics for Amazon EC2. aws cloudwatch list-metrics --namespace AWS/EC2 The following is example output. { View available metrics 210 User Guide Amazon CloudWatch "Metrics" : [ ... { "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ], "MetricName": "NetworkOut" }, { "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ], "MetricName": "CPUUtilization" }, { "Namespace": "AWS/EC2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-1234567890abcdef0" } ], "MetricName": "NetworkIn" }, ... ] } To list all the available metrics for a specified resource The following example specifies the AWS/EC2 namespace and the InstanceId dimension to view the results for the specified instance only. aws cloudwatch list-metrics --namespace AWS/EC2 --dimensions Name=InstanceId,Value=i-1234567890abcdef0 View available metrics 211 Amazon CloudWatch To list a metric for all resources User Guide The following example specifies the AWS/EC2 namespace and a metric name to view the results for the specified metric only. aws cloudwatch list-metrics --namespace AWS/EC2 --metric-name CPUUtilization To retrieve metrics from linked source accounts in CloudWatch cross-account observability The following example is run in a monitoring account to retrieve metrics from both the monitoring account and all linked source accounts. If you do not add --include-linked-accounts, the command returns only the monitoring account’s metrics. aws cloudwatch list-metrics --include-linked-accounts To retrieve metrics from a source account in CloudWatch cross-account observability The following example is run in a monitoring account to retrieve metrics from the source account with the ID 111122223333. aws cloudwatch list-metrics --include-linked-accounts --owning-account "111122223333" Search for available metrics You can search within all of the metrics in your account using targeted search terms. Metrics are returned that have matching results within their namespace, metric name, or dimensions. If this is a monitoring account in CloudWatch cross-account observability, you also search for metrics from the source accounts linked to this monitoring account. Note Metrics that have not had any new data points in the past two weeks do not appear in the console. They also do not appear when you type their metric name or dimension names in the search box in the All metrics tab in the console, and they are not returned in the results of a list-metrics command. The best way to retrieve these metrics is with the get-metric- data or get-metric-statistics commands in the AWS CLI. Search for available metrics 212 Amazon CloudWatch User Guide To search for available metrics in CloudWatch 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, All metrics. In the search field, enter a search term, such as a metric name, namespace, account ID, account label, dimension name or value, or resource name. This shows you all of the namespaces with metrics with this search term. For example, if you search for volume, this shows the namespaces that contain metrics with this term in their name. For more information on search, see Use search expressions in graphs 4. To graph all the search results, choose Graph search or Select a namespace to view the metrics from that namespace. You can then do the following: a. To graph one or more metrics, select the check box next |
acw-ug-082 | acw-ug.pdf | 82 | such as a metric name, namespace, account ID, account label, dimension name or value, or resource name. This shows you all of the namespaces with metrics with this search term. For example, if you search for volume, this shows the namespaces that contain metrics with this term in their name. For more information on search, see Use search expressions in graphs 4. To graph all the search results, choose Graph search or Select a namespace to view the metrics from that namespace. You can then do the following: a. To graph one or more metrics, select the check box next to each metric. To select all metrics, select the check box in the heading row of the table. b. c. To refine your search, hover over a metric name and choose Add to search or Search for this only. To view one of the resources on its console, choose the resource ID and then choose Jump to resource. d. To view help for a metric, select the metric name and choose What is this?. The selected metrics appear on the graph. Search for available metrics 213 Amazon CloudWatch User Guide 5. (Optional) Select one of the buttons in the search bar to edit that part of the search term. Graphing metrics Use the CloudWatch console to graph metric data generated by other AWS services. This makes it more efficient to see the metric activity on your services. The following procedures describe how to graph metrics in CloudWatch. Contents • Graph a metric • Merge two graphs into one • Use dynamic labels • Modify the time range or time zone format for a graph • Zoom in on a line graph or stacked area graph • Modify the y-axis for a graph • Create an alarm from a metric on a graph Graphing metrics 214 Amazon CloudWatch Graph a metric User Guide You can select metrics and create graphs of the metric data using the CloudWatch console. CloudWatch supports the following statistics on metrics: Average, Minimum, Maximum, Sum, and SampleCount. For more information, see Statistics. You can view your data at different levels of detail. For example, you can choose a one-minute view, which can be useful when troubleshooting. Or, choose a less detailed, one-hour view. That can be useful when viewing a broader time range (for example, 3 days) so that you can see trends over time. For more information, see Periods. If you are using an account that is set up as a monitoring account in CloudWatch cross-account observability, you can graph metrics from the source accounts linked to this monitoring account. For more information, see CloudWatch cross-account observability. Creating a graph To graph a metric 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. 5. 6. In the navigation pane, choose Metrics, All metrics. In the Browse tab, enter a search term in the search field, such as a metric name, account ID, or resource name. For example, if you search for the CPUUtilization metric, you see the namespaces and dimensions with this metric. Select one of the results for your search to view the metrics. To graph one or more metrics, select the check box next to each metric. To select all metrics, select the check box in the heading row of the table. (Optional) To change the type of graph, choose the Options tab. You can then choose between a line graph, stacked area chart, number display, gauge, bar chart, or pie chart. 7. Choose the Graphed metrics tab. 8. (Optional) To change the statistic used in the graph, choose the new statistic in the Statistic column next to the metric name. For more information about CloudWatch statistics, see CloudWatch statistics definitions. For more information about the pxx percentile statistics, see Percentiles. Graph a metric 215 Amazon CloudWatch User Guide 9. (Optional) To add an anomaly detection band that shows expected values for the metric, choose the anomaly detection icon under Actions next to the metric. For more information about anomaly detection, see Using CloudWatch anomaly detection. CloudWatch uses up to two weeks of the metric's recent historical data to calculate a model for expected values. It then displays this range of expected values as a band on the graph. CloudWatch adds a new row under the metric to display the anomaly detection band math expression, labeled ANOMALY_DETECTION_BAND. If recent historical data exists, you immediately see a preview anomaly detection band, which is an approximation of the anomaly detection band generated by the model. It takes up to 15 minutes for the actual anomaly detection band to appear. By default, CloudWatch creates the upper and lower bounds of the band of expected values with a default value of 2 for the band threshold. To change this number, change the value at the end of |
acw-ug-083 | acw-ug.pdf | 83 | as a band on the graph. CloudWatch adds a new row under the metric to display the anomaly detection band math expression, labeled ANOMALY_DETECTION_BAND. If recent historical data exists, you immediately see a preview anomaly detection band, which is an approximation of the anomaly detection band generated by the model. It takes up to 15 minutes for the actual anomaly detection band to appear. By default, CloudWatch creates the upper and lower bounds of the band of expected values with a default value of 2 for the band threshold. To change this number, change the value at the end of the formula under Details for the band. • (Optional) Choose Edit model to change how the anomaly detection model is calculated. You can exclude past and future time periods from being used in the training for calculating the model. It is critical to exclude unusual events system as system outage, deployments, and holidays from the training data. You can also specify the time zone to use for the model for daylight saving time changes. For more information, see Editing an anomaly detection model . Graph a metric 216 Amazon CloudWatch User Guide For more information about anomaly detection, see Using CloudWatch anomaly detection. To hide the model from the graph, remove the check mark from the line with the ANOMALY_DETECTION_BAND function or choose the X icon. To delete the model entirely, choose Edit model, Delete model. 10. (Optional) As you choose metrics to graph, specify a dynamic label to appear on the graph legend for each metric. Dynamic labels display a statistic about the metric, and automatically update when the dashboard or graph is refreshed. To add a dynamic label, choose Graphed metrics, Add dynamic label. By default, the dynamic values that you add to the label appear at the beginning of the label. You can then choose the Label value for the metric to edit the label. For more information, see Use dynamic labels. 11. To view more information about the metric being graphed, pause the mouse over the legend. 12. Horizontal annotations can help graph users more efficiently see when a metric has spiked to a certain level, or whether the metric is within a predefined range. To add a horizontal annotation, choose the Options tab and then Add horizontal annotation: a. b. c. d. For Label, enter a label for the annotation. For Value, enter the metric value where the horizontal annotation appears. For Fill, specify whether to use fill shading with this annotation. For example, choose Above or Below for the corresponding area to be filled. If you specify Between, another Value field appears, and the area of the graph between the two values is filled. For Axis, specify whether the numbers in Value refer to the metric associated with the left Y-axis or the right Y-axis, if the graph includes multiple metrics. You can change the fill color of an annotation by choosing the color square in the left column of the annotation. Repeat these steps to add multiple horizontal annotations to the same graph. To hide an annotation, clear the check box in the left column for that annotation. To delete an annotation, choose x in the Actions column. 13. To get a URL for your graph, choose Actions, Share. Copy the URL to save or share. Graph a metric 217 Amazon CloudWatch User Guide 14. To add your graph to a dashboard, choose Actions, Add to dashboard. Creating a graph of metrics from another data source You can create a graph that displays resources from data sources other than CloudWatch. For more information about creating connections to these other data sources, see Query metrics from other data sources. To graph a metric from another data source 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the Multi source query tab. 4. For Data source, select the data source that you want to use. If you haven't already created a connection to the data source that you want, select Create and manage data sources, then choose Create and manage data sources. For information about the rest of this data source creation process, see Connect to a prebuilt data source with a wizard. 5. The wizard or query editor prompts you for the information necessary for the query. The workflow is different for each data source, and is tailored to the data source. For example, for Amazon Managed Service for Prometheus; and Prometheus data sources, a PromQL query editor box with a query helper appear. 6. When you have finished constructing the query, choose Graph query. The graph is populated with metrics from the query. 7. (Optional) Horizontal annotations can help graph users more efficiently see when a metric has spiked to a certain level, or |
acw-ug-084 | acw-ug.pdf | 84 | a prebuilt data source with a wizard. 5. The wizard or query editor prompts you for the information necessary for the query. The workflow is different for each data source, and is tailored to the data source. For example, for Amazon Managed Service for Prometheus; and Prometheus data sources, a PromQL query editor box with a query helper appear. 6. When you have finished constructing the query, choose Graph query. The graph is populated with metrics from the query. 7. (Optional) Horizontal annotations can help graph users more efficiently see when a metric has spiked to a certain level, or whether the metric is within a predefined range. To add a horizontal annotation, choose the Options tab and then Add horizontal annotation: a. b. c. For Label, enter a label for the annotation. For Value, enter the metric value where the horizontal annotation appears. For Fill, specify whether to use fill shading with this annotation. For example, choose Above or Below for the corresponding area to be filled. If you specify Between, another Value field appears, and the area of the graph between the two values is filled. Graph a metric 218 Amazon CloudWatch User Guide d. For Axis, specify whether the numbers in Value refer to the metric associated with the left Y-axis or the right Y-axis, if the graph includes multiple metrics. You can change the fill color of an annotation by choosing the color square in the left column of the annotation. Repeat these steps to add multiple horizontal annotations to the same graph. To hide an annotation, clear the check box in the left column for that annotation. To delete an annotation, choose x in the Actions column. 8. (Optional) To add this graph to a dashboard, choose Actions, Add to dashboard. Updating a graph To update your graph 1. 2. 3. 4. 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. For more information, see Modify the time range or time zone format for a graph. 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, p95.45). To change the period, choose the Graphed metrics tab. Choose the column heading or an individual value and then choose a different value. 5. To add a horizontal annotation, choose Graph options and then Add horizontal annotation: a. b. c. d. For Label, enter a label for the annotation. For Value, enter the metric value where the horizontal annotation appears. For Fill, specify whether to use fill shading with this annotation. For example, choose Above or Below for the corresponding area to be filled. If you specify Between, another Value field appears, and the area of the graph between the two values is filled. For Axis, specify whether the numbers in Value refer to the metric associated with the left y-axis or the right y-axis, if the graph includes multiple metrics. Graph a metric 219 Amazon CloudWatch User Guide You can change the fill color of an annotation by choosing the color square in the left column of the annotation. Repeat these steps to add multiple horizontal annotations to the same graph. To hide an annotation, clear the check box in the left column for that annotation. To delete an annotation, choose x in the Actions column. 6. To change the refresh interval, choose Refresh options and then select Auto refresh or choose 1 Minute, 2 Minutes, 5 Minutes, or 15 Minutes. Duplicating a metric To duplicate a metric 1. Choose the Graphed metrics tab. 2. For Actions, choose the Duplicate icon. 3. Update the duplicate metric as needed. Merge two graphs into one You can merge two different graphs into one, and then the resulting graph shows both metrics. This can be useful if you already have different metrics displayed in different graphs and want to combine them, or you want to easily create a single graph with metrics from different Regions. To merge a graph into another one, you use either the URL or JSON source of the graph that you want to merge in. Merge two graphs into one 220 Amazon CloudWatch To merge two graphs into one User Guide 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Open the graph that you want to merge into another graph. To do so, you can choose Metrics, All metrics, and then choose a metric to graph. Or you can open a dashboard and then open one of the graphs on the dashboard by selecting the graph and choosing Open in metrics from the menu at the upper right of the graph. 3. After you have a |
acw-ug-085 | acw-ug.pdf | 85 | of the graph that you want to merge in. Merge two graphs into one 220 Amazon CloudWatch To merge two graphs into one User Guide 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Open the graph that you want to merge into another graph. To do so, you can choose Metrics, All metrics, and then choose a metric to graph. Or you can open a dashboard and then open one of the graphs on the dashboard by selecting the graph and choosing Open in metrics from the menu at the upper right of the graph. 3. After you have a graph open, do one of the following:. • • Copy the URL from the browser bar. Choose the Source tab and then choose Copy. 4. Open the graph that you want to merge the previous graph into. 5. When you have the second graph open in the Metrics view, choose Actions, Merge graph. 6. 7. Enter the URL or JSON that you previously copied, and choose Merge. The merged graphs appear. The y-axis on the left is for the original graph, and the y-axis on the right is for the graph that you merged into it. Note If the graph that you merged into uses the METRICS() function, the metrics in the graph that was merged in are not included in the METRICS() calculation in the merged graph. 8. To save the merged graph to a dashboard, choose Actions, Add to dashboard. Use dynamic labels You can use dynamic labels with your graphs. Dynamic labels add a dynamically updated value to the label for the selected metric. You can add a wide range of values to the labels, as shown in the following tables. The dynamic value shown in the label is derived from the time range currently shown on the graph. The dynamic part of the label automatically updates when either the dashboard or the graph is refreshed. If you use a dynamic label with a search expression, the dynamic label applies to every metric returned by the search. Use dynamic labels 221 Amazon CloudWatch User Guide You can use the CloudWatch console to add a dynamic value to a label, edit the label, change the position of the dynamic value within the label column, and make other customizations. Dynamic labels Within a dynamic label, you can use the following values relating to properties of the metric: Dynamic label live value Description ${AVG} The average of the values in the time range currently shown in the graph. ${DATAPOINT_COUNT} The number of data points in the time range that is currently shown in the graph. ${FIRST} The oldest of the metric values in the time range that is currently shown in the graph. ${FIRST_LAST_RANGE} The difference between the metric values of the oldest and newest data points that are currently shown in the graph. ${FIRST_LAST_TIME_RANGE} The absolute time range between the oldest and newest data points that are currently shown in the graph. ${FIRST_TIME} The timestamp of the oldest data point in the time range that is currently shown in the graph. ${FIRST_TIME_RELATIVE} The absolute time difference between now and the timestamp of the oldest data point in the time range that is currently shown in the graph. ${LABEL} ${LAST} ${LAST_TIME} The representation of the default label for a metric. The most recent of the metric values in the time range that is currently shown in the graph. The timestamp of the newest data point in the time range that is currently shown in the graph. Use dynamic labels 222 Amazon CloudWatch User Guide Dynamic label live value Description ${LAST_TIME_RELATIVE} The absolute time difference between now and the timestamp of the newest data point in the time range that is currently shown in the graph. ${MAX} ${MAX_TIME} ${MAX_TIME_RELATIVE} The maximum of the values in the time range currently shown in the graph. The timestamp of the data point that has the highest metric value, of the data points that are currently shown in the graph. The absolute time difference between now and the timestamp of the data point with the highest value, of those data points that are currently shown in the graph. ${MIN} The minimum of the values in the time range currently shown in the graph. ${MIN_MAX_RANGE} The difference in metric values between the data points with the highest and lowest metric values, of those data points that are currently shown in the graph. ${MIN_MAX_TIME_RANGE} The absolute time range between the data points with the highest and lowest metric values, of those data points that are currently shown in the graph. ${MIN_TIME} The timestamp of the data point that has the lowest metric value, of the data points that are currently shown in the graph. ${MIN_TIME_RELATIVE} The absolute time difference between now and the timestamp of the data |
acw-ug-086 | acw-ug.pdf | 86 | the time range currently shown in the graph. ${MIN_MAX_RANGE} The difference in metric values between the data points with the highest and lowest metric values, of those data points that are currently shown in the graph. ${MIN_MAX_TIME_RANGE} The absolute time range between the data points with the highest and lowest metric values, of those data points that are currently shown in the graph. ${MIN_TIME} The timestamp of the data point that has the lowest metric value, of the data points that are currently shown in the graph. ${MIN_TIME_RELATIVE} The absolute time difference between now and the timestamp of the data point with the lowest value, of those data points that are currently shown in the graph. ${PROP('AccountId')} The AWS account ID of the metric. ${PROP('AccountLabel')} The label specified for the source account that owns this metric, in CloudWatch cross-account observability. Use dynamic labels 223 Amazon CloudWatch User Guide Dynamic label live value Description ${PROP('Dim.dimension _name ')} The value of the specified dimension. Replace dimension _name with the case-sensitive name of your dimension. ${PROP('MetricName')} The name of the metric. ${PROP('Namespace')} The namespace of the metric. ${PROP('Period')} The period of the metric, in seconds. ${PROP('Region')} The AWS Region where the metric is published. ${PROP('Stat')} The metric statistic that is being graphed. ${SUM} The sum of the values in the time range currently shown in the graph. For example, suppose you have a search expression SEARCH(' {AWS/Lambda, FunctionName} Errors ', 'Sum'), which finds the Errors for each of your Lambda functions. If you set the label to be [max: ${MAX} Errors for Function Name ${LABEL}], the label for each metric is [max: number Errors for Function Name Name]. You can add as many as six dynamic values to a label. You can use the ${LABEL} placeholder only once within each label. Modify the time range or time zone format for a graph This section describes how you can modify the date, time, and time zone format on a CloudWatch metrics graph. It also describes how you can zoom in on a graph to apply a specific time range. For information about creating a graph, see Graph a metric. Note If the time range of a dashboard is shorter than the period used for a graph on the dashboard, the following happens: Modify the time range or time zone format for a graph 224 Amazon CloudWatch User Guide • The graph is modified to display the amount of data corresponding one complete period for that widget, even though this is longer than the dashboard time range. This ensures that there is at least one data point on the graph. • The start time of the period for this data point is adjusted backwards to ensure that at least one data point can be displayed. Set a relative time range New interface To specify a relative time range for a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose Custom to set your own time range. 3. Choose Custom, and then select the Relative tab in the upper left corner of the box. You can specify a time range in Minutes, Hours, Days, Weeks, Months. 4. After you specify a time range, choose Apply. Original interface To specify a relative time range for a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose custom to set your own time range. 3. Choose custom, and then choose Relative in the upper left corner of the box. You can specify a time range in Minutes, Hours, Days, Weeks, or Months. Modify the time range or time zone format for a graph 225 Amazon CloudWatch Set an absolute time range New interface To specify an absolute time range for a graph User Guide 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose Custom to set your own time range. 3. Choose Custom, and then select the Absolute tab in the upper left corner of the box. Use the calendar picker or text field boxes to specify a time |
acw-ug-087 | acw-ug.pdf | 87 | an absolute time range for a graph User Guide 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose Custom to set your own time range. 3. Choose Custom, and then select the Absolute tab in the upper left corner of the box. Use the calendar picker or text field boxes to specify a time range. 4. After you specify a time range, choose Apply. Original interface To specify an absolute time range for a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose custom to set your own time range. 3. Choose custom, and then choose Absolute in the upper left corner of the box. Use the calendar picker or text field boxes to specify a time range. 4. After you specify a time range, choose Apply. Set the time zone format New interface To specify the time zone for a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 Modify the time range or time zone format for a graph 226 Amazon CloudWatch User Guide hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose Custom to set your own time range. 3. Choose Custom, and then choose the dropdown in the upper right corner of the box. You can change the time zone to UTC or Local time zone. 4. After you make your changes, choose Apply. Original interface To specify the time zone for a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. In the upper right corner of the screen, you can select one of the predefined time ranges, which span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose custom to set your own time range. 3. Choose custom, and then choose the dropdown in the upper right corner of the box. You can change the time zone to UTC or Local timezone. Zoom in on a line graph or stacked area graph In the CloudWatch console, you can use the mini-map zoom feature to focus on sections of line graphs and stacked area graphs without changing between zoomed-in and zoomed-out views. For example, you can use the mini-map zoom feature to focus on a peak in a line graph, so that you can compare the spike against other metrics in your dashboard from the same timeline. The procedures in this section describe how to use the zoom feature. Zooming in on a graph 227 Amazon CloudWatch User Guide In the preceding image, the zoom feature focuses on a spike in a line graph that's related to the input bytes processing rate while also showing other line graphs in the dashboard that focus on sections from the same timeline. New interface To zoom in on a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. 3. Choose Browse, and then select a metric or metrics to graph. 4. Choose Options, and select Line under Widget type. 5. Choose and drag on the area of the graph that you want to focus on, and then release the drag. 6. To reset the zoom, choose the Reset zoom icon, which looks like a magnifying glass with a minus (-) symbol inside. Original interface To zoom in on a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. Zooming in on a graph 228 Amazon CloudWatch User Guide 2. In the navigation pane, choose Metrics, and then choose All metrics. . 3. Choose All metrics, and then select a metric to graph. 4. Choose Graph options. Under Widget type select Line. 5. Choose and drag on the area of the graph that you want to focus on, and then release the drag. 6. To reset the zoom, choose the Reset zoom icon, which looks like a magnifying glass with a minus (-) symbol inside. Tip If you already created a dashboard that contains a line graph or stacked area graph, you can go to the dashboard and begin |
acw-ug-088 | acw-ug.pdf | 88 | 2. In the navigation pane, choose Metrics, and then choose All metrics. . 3. Choose All metrics, and then select a metric to graph. 4. Choose Graph options. Under Widget type select Line. 5. Choose and drag on the area of the graph that you want to focus on, and then release the drag. 6. To reset the zoom, choose the Reset zoom icon, which looks like a magnifying glass with a minus (-) symbol inside. Tip If you already created a dashboard that contains a line graph or stacked area graph, you can go to the dashboard and begin using the zoom feature. Modify the y-axis for a graph You can set custom bounds for the y-axis on a graph to help you see the data better. For example, you can change the bounds on a CPUUtilization graph to 100 percent so that it's easy to see whether the CPU is low (the plotted line is near the bottom of the graph) or high (the plotted line is near the top of the graph). You can switch between two different y-axes for your graph. This is useful if the graph contains metrics that have different units or that differ greatly in their range of values. To modify the y-axis on a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Metrics, All metrics. Select a metric namespace (for example, EC2) and then a metric dimension (for example, Per- Instance Metrics). The All metrics tab displays all metrics for that dimension in that namespace. To graph a metric, select the check box next to the metric. 5. On the Graph options tab, specify the Min and Max values for Left Y Axis. The value of Min can't be greater than the value of Max. Modify the y-axis for a graph 229 Amazon CloudWatch User Guide 6. 7. To create a second y-axis, specify the Min and Max values for Right Y Axis. To switch between the two y-axes, choose the Graphed metrics tab. For Y Axis, choose Left Y Axis or Right Y Axis. Create an alarm from a metric on a graph You can graph a metric and then create an alarm from the metric on the graph, which has the benefit of populating many of the alarm fields for you. To create an alarm from a metric on a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, All metrics. Select a metric namespace (for example, EC2) and then a metric dimension (for example, Per- Instance Metrics). Create an alarm from a metric on a graph 230 Amazon CloudWatch User Guide 4. 5. The All metrics tab displays all metrics for that dimension in that namespace. To graph a metric, select the check box next to the metric. To create an alarm for the metric, choose the Graphed metrics tab. For Actions, choose the alarm icon. 6. Under Conditions, choose Static or Anomaly detection to specify whether to use a static threshold or anomaly detection model for the alarm. Depending on your choice, enter the rest of the data for the alarm conditions. 7. Choose Additional configuration. For Datapoints to alarm, specify how many evaluation periods (data points) must be in the ALARM state to trigger the alarm. If the two values here match, you create an alarm that goes to ALARM state if that many consecutive periods are breaching. To create an M out of N alarm, specify a lower number for the first value than you specify for the second value. For more information, see Evaluating an alarm. 8. For Missing data treatment, choose how to have the alarm behave when some data points are missing. For more information, see Configuring how CloudWatch alarms treat missing data. 9. Choose Next. 10. Under Notification, select an SNS topic to notify when the alarm is in ALARM state, OK state, or INSUFFICIENT_DATA state. To have the alarm send multiple notifications for the same alarm state or for different alarm states, choose Add notification. To have the alarm not send notifications, choose Remove. 11. To have the alarm perform Auto Scaling or EC2 actions, choose the appropriate button and choose the alarm state and action to perform. 12. When finished, choose Next. Create an alarm from a metric on a graph 231 Amazon CloudWatch User Guide 13. Enter a name and description for the alarm. The name must contain only ASCII characters. Then choose Next. 14. Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm. Using CloudWatch anomaly detection When you enable anomaly detection for a metric, CloudWatch applies statistical and machine learning algorithms. These algorithms continuously analyze metrics of systems and applications, determine normal baselines, |
acw-ug-089 | acw-ug.pdf | 89 | the appropriate button and choose the alarm state and action to perform. 12. When finished, choose Next. Create an alarm from a metric on a graph 231 Amazon CloudWatch User Guide 13. Enter a name and description for the alarm. The name must contain only ASCII characters. Then choose Next. 14. Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm. Using CloudWatch anomaly detection When you enable anomaly detection for a metric, CloudWatch applies statistical and machine learning algorithms. These algorithms continuously analyze metrics of systems and applications, determine normal baselines, and surface anomalies with minimal user intervention. The algorithms generate an anomaly detection model. The model generates a range of expected values that represent normal metric behavior. You can enable anomaly detection using the AWS Management Console, the AWS CLI, AWS CloudFormation, or the AWS SDK. You can enable anomaly detection on metrics vended by AWS and also on custom metrics. In an account set up as a monitoring account for CloudWatch cross- account observability, you can create anomaly detectors on metrics in source accounts in addition to metrics in the monitoring account. You can use the model of expected values in two ways: • Create anomaly detection alarms based on a metric's expected value. These types of alarms don't have a static threshold for determining alarm state. Instead, they compare the metric's value to the expected value based on the anomaly detection model. You can choose whether the alarm is triggered when the metric value is above the band of expected values, below the band, or both. For more information, see Create a CloudWatch alarm based on anomaly detection. • When viewing a graph of metric data, overlay the expected values onto the graph as a band. This makes it visually clear which values in the graph are out of the normal range. For more information, see Creating a graph. You can also retrieve the upper and lower values of the model's band by using the GetMetricData API request with the ANOMALY_DETECTION_BAND metric math function. For more information, see GetMetricData. Using anomaly detection 232 Amazon CloudWatch User Guide In a graph with anomaly detection, the expected range of values is shown as a gray band. If the metric's actual value goes beyond this band, it is shown as red during that time. Anomaly detection algorithms account for the seasonality and trend changes of metrics. The seasonality changes could be hourly, daily, or weekly, as shown in the following examples. The longer-range trends could be downward or upward. Using anomaly detection 233 Amazon CloudWatch User Guide Anomaly detections also works well with metrics with flat patterns. How CloudWatch anomaly detection works When you enable anomaly detection for a metric, CloudWatch applies machine learning algorithms to the metric's past data to create a model of the metric's expected values. The model assesses both trends and hourly, daily, and weekly patterns of the metric. The algorithm trains on up to two weeks of metric data, but you can enable anomaly detection on a metric even if the metric does not have a full two weeks of data. You specify a value for the anomaly detection threshold that CloudWatch uses along with the model to determine the "normal" range of values for the metric. A higher value for the anomaly detection threshold produces a thicker band of "normal" values. The machine learning model is specific to a metric and a statistic. For example, if you enable anomaly detection for a metric using the AVG statistic, the model is specific to the AVG statistic. When CloudWatch creates a model for many common metrics from AWS services, it ensures that the band doesn’t extend outside of logical values. For example, the band for MemoryUtilization of an EC2 instance will stay between 0 and 100, and the bands tracking CloudFront Requests, which can't be negative, will never extend below zero. After you create a model, CloudWatch anomaly detection continually evaluates the model and makes adjustments to it to ensure that it is as accurate as possible. This includes re-training the model to adjust if the metric values evolve over time or have sudden changes, and also includes predictors to improve the models of metrics that are seasonal, spiky, or sparse. After you enable anomaly detection on a metric, you can choose to exclude specified time periods of the metric from being used to train the model. This way, you can exclude deployments or other unusual events from being used for model training, ensuring the most accurate model is created. How anomaly detection works 234 Amazon CloudWatch User Guide Using anomaly detection models for alarms incurs charges on your AWS account. For more information, see Amazon CloudWatch Pricing. Anomaly detection on metric math Anomaly detection on metric |
acw-ug-090 | acw-ug.pdf | 90 | includes predictors to improve the models of metrics that are seasonal, spiky, or sparse. After you enable anomaly detection on a metric, you can choose to exclude specified time periods of the metric from being used to train the model. This way, you can exclude deployments or other unusual events from being used for model training, ensuring the most accurate model is created. How anomaly detection works 234 Amazon CloudWatch User Guide Using anomaly detection models for alarms incurs charges on your AWS account. For more information, see Amazon CloudWatch Pricing. Anomaly detection on metric math Anomaly detection on metric math is a feature that you can use to create anomaly detection alarms on the output metric math expressions. You can use these expressions to create graphs that visualize anomaly detection bands. The feature supports basic arithmetic functions, comparison and logical operators, and most other functions. For information about functions that are not supported, see Using metric math in the Amazon CloudWatch User Guide. You can create anomaly detection models based on metric math expressions similar to how you already create anomaly detection models. From the CloudWatch console, you can apply anomaly detection to metric math expressions and select anomaly detection as a threshold type for these expressions. Note Anomaly detection on metric math only can be enabled and edited in the latest version of the metrics user interface. When you create anomaly detectors based on metric math expressions in the new version of the interface, you can view them in the old version, but not edit them. For information about how to create, edit, and delete alarms and models for anomaly detection and metric math, see the following sections: • Create a CloudWatch alarm based on anomaly detection • Editing an anomaly detection model • Deleting an anomaly detection model • Creating a CloudWatch alarm based on a metric math expression You also can create, delete, and discover anomaly detection models based on metric math expressions using the CloudWatch API with PutAnomalyDetector, DeleteAnomalyDetector, and DescribeAnomalyDetectors. For information about these API actions, see the following sections in the Amazon CloudWatch API Reference. • PutAnomalyDetector Anomaly detection on metric math 235 Amazon CloudWatch • DeleteAnomalyDetector • DescribeAnomalyDetectors User Guide For information about how anomaly detection alarms are priced, see Amazon CloudWatch pricing. Using math expressions with CloudWatch metrics Metric math enables you to query multiple CloudWatch metrics and use math expressions to create new time series based on these metrics. You can visualize the resulting time series on the CloudWatch console and add them to dashboards. Using AWS Lambda metrics as an example, you could divide the Errors metric by the Invocations metric to get an error rate. Then add the resulting time series to a graph on your CloudWatch dashboard. You can also perform metric math programmatically, using the GetMetricData API operation. For more information, see GetMetricData. Add a math expression to a CloudWatch graph You can add a math expression to a graph on your CloudWatch dashboard. Each graph is limited to using a maximum of 500 metrics and expressions, so you can add a math expression only if the graph has 499 or fewer metrics. This applies even if not all the metrics are displayed on the graph. To add a math expression to a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Create or edit a graph. There needs to be at least one metric in the graph. 3. Choose Graphed metrics. 4. Choose Math expression, Start with empty expression. A new line appears for the expression. 5. In the new line, under the Details column, enter the math expression. The tables in the Metric Math Syntax and Functions section list the functions that you can use in the expression. To use a metric or the result of another expression as part of the formula for this expression, use the value shown in the Id column: for example, m1+m2 or e1-MIN(e1). You can change the value of Id. It can include numbers, letters, an underscore, and must start with a lowercase letter. Changing the value of Id to a more meaningful name can also make a graph easier to understand;for example, changing m1 and m2 to errors and requests. Using math expressions with CloudWatch metrics 236 Amazon CloudWatch Tip User Guide Choose the down arrow next to Math Expression to see a list of supported functions, which you can use when creating your expression. 6. For the Label column of the expression, enter a name that describes what the expression is calculating. If the result of an expression is an array of time series, each of those time series is displayed on the graph with a separate line, with different colors. Immediately under the graph is a legend for each line in the graph. For a |
acw-ug-091 | acw-ug.pdf | 91 | errors and requests. Using math expressions with CloudWatch metrics 236 Amazon CloudWatch Tip User Guide Choose the down arrow next to Math Expression to see a list of supported functions, which you can use when creating your expression. 6. For the Label column of the expression, enter a name that describes what the expression is calculating. If the result of an expression is an array of time series, each of those time series is displayed on the graph with a separate line, with different colors. Immediately under the graph is a legend for each line in the graph. For a single expression that produces multiple time series, the legend captions for those time series are in the format Expression-Label Metric- Label. For example, if the graph includes a metric with a label of Errors and an expression FILL(METRICS(), 0) that has a label of Filled With 0:, one line in the legend would be Filled With 0: Errors. To have the legend show only the original metric labels, set Expression- Label to be empty. When one expression produces an array of time series on the graph, you can't change the colors used for each of those time series. 7. After you have added the desired expressions, you can simplify the graph by hiding some of the original metrics. To hide a metric or expression, clear the check box to the left of the Id field. Metric math syntax and functions The following sections explain the functions available for metric math. All functions must be written in uppercase letters (such as AVG), and the Id field for all metrics and math expressions must start with a lowercase letter. The final result of any math expression must be a single time series or an array of time series. Some functions produce a scalar number. You can use these functions within a larger function that ultimately produces a time series. For example, taking the AVG of a single time series produces a scalar number, so it can't be the final expression result. But you could use it in the function m1- AVG(m1) to display a time series of the difference between each individual data point and the average value in the time series. Metric math syntax and functions 237 Amazon CloudWatch Data type abbreviations User Guide Some functions are valid for only certain types of data. The abbreviations in the following list are used in the tables of functions to represent the types of data supported for each function: • S represents a scalar number, such as 2, -5, or 50.25. • TS is a time series (a series of values for a single CloudWatch metric over time): for example, the CPUUtilization metric for instance i-1234567890abcdef0 over the last three days. • TS[] is an array of time series, such as the time series for multiple metrics. • String[] is an array of strings. The METRICS() function The METRICS() function returns all the metrics in the request. Math expressions aren't included. You can use METRICS() within a larger expression that produces a single time series or an array of time series. For example, the expression SUM(METRICS()) returns a time series (TS) that is the sum of the values of all the graphed metrics. METRICS()/100 returns an array of time series, each of which is a time series showing each data point of one of the metrics divided by 100. You can use the METRICS() function with a string to return only the graphed metrics that contain that string in their Id field. For example, the expression SUM(METRICS("errors")) returns a time series that is the sum of the values of all the graphed metrics that have ‘errors’ in their Id field. You can also use SUM([METRICS(“4xx”), METRICS(“5xx”)]) to match multiple strings. Basic arithmetic functions The following table lists the basic arithmetic functions that are supported. Missing values in a time series are treated as 0. If the value of a data point causes a function to attempt to divide by zero, the data point is dropped. Operation Arguments Examples Arithmetic operators: + - * / ^ S, S S, TS TS, TS PERIOD(m1)/60 5 * m1 m1 - m2 Metric math syntax and functions 238 Amazon CloudWatch Operation Arguments Examples User Guide Unary subtraction - S, TS[] TS, TS[] S TS TS[] SUM(100/[m1, m2]) AVG(METRICS()) METRICS()*100 -5*m1 -m1 SUM(-[m1, m2]) Comparison and logical operators You can use comparison and logical operators with either a pair of time series or a pair of single scalar values. When you use a comparison operator with a pair of time series, the operators return a time series where each data point is either 0 (false) or 1 (true). If you use a comparison operator on a pair of scalar values, a single scalar value is returned, either 0 |
acw-ug-092 | acw-ug.pdf | 92 | 238 Amazon CloudWatch Operation Arguments Examples User Guide Unary subtraction - S, TS[] TS, TS[] S TS TS[] SUM(100/[m1, m2]) AVG(METRICS()) METRICS()*100 -5*m1 -m1 SUM(-[m1, m2]) Comparison and logical operators You can use comparison and logical operators with either a pair of time series or a pair of single scalar values. When you use a comparison operator with a pair of time series, the operators return a time series where each data point is either 0 (false) or 1 (true). If you use a comparison operator on a pair of scalar values, a single scalar value is returned, either 0 or 1. When comparison operators are used between two time series, and only one of the time series has a value for a particular time stamp, the function treats the missing value in the other time series as 0. You can use logical operators in conjunction with comparison operators, to create more complex functions. The following table lists the operators that are supported. Type of operator Comparison operators Supported operators == != <= >= < Metric math syntax and functions 239 Amazon CloudWatch Type of operator Logical operators User Guide Supported operators > AND or && OR or || To see how these operators are used, suppose we have two time series: metric1 has values of [30, 20, 0, 0] and metric2 has values of [20, -, 20, -] where - indicates that there is no value for that timestamp. Expression (metric1 < metric2) (metric1 >= 30) (metric1 > 15 AND metric2 > 15) Output 0, 0, 1, 0 1, 0, 0, 0 1, 0, 0, 0 Functions supported for metric math The following table describes the functions that you can use in math expressions. Enter all functions in uppercase letters. The final result of any math expression must be a single time series or an array of time series. Some functions in tables in the following sections produce a scalar number. You can use these functions within a larger function that ultimately produces a time series. For example, taking the AVG of a single time series produces a scalar number, so it can't be the final expression result. But you could use it in the function m1-AVG(m1) to display a time series of the difference between each individual data point and the average value of that data point. In the following table, every example in the Examples column is an expression that results in a single time series or an array of time series. These examples show how functions that return scalar numbers can be used as part of a valid expression that produces a single time series. Metric math syntax and functions 240 Amazon CloudWatch Function ArgumentsReturn Description Examples type* ABS TS TS Returns the absolute value of each data ABS(m1-m2) User Guide Supported for cross- acc ount? ✓ MIN(ABS([m1, m2])) ABS(METRICS()) ANOMALY_D ETECTION_BAND(m1) ANOMALY_D ETECTION_BAND(m1,4 ) TS[] TS[] point. ANOMALY_D ETECTION_ BAND TS TS[] TS, S Returns an anomaly detection band for the specified metric. The band consists of two time series, one representing the upper limit of the "normal" expected value of the metric, and the other representing the lower limit. The function can take two arguments . The first is the ID of the metric to create the band for. The second argument is the number of standard deviations to use for the band. If you don't specify this argument, the default of 2 is used. For more information, see Using CloudWatch anomaly detection. Metric math syntax and functions 241 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? AVG TS S TS[] TS The AVG of a single time series returns a SUM([m1,m2])/AVG(m 2) ✓ AVG(METRICS()) scalar representing the average of all the data points in the metric. The AVG of an array of time series returns a single time series. Missing values are treated as 0. Note We recommend that you do not use this function in CloudWatc h alarms if you want the function to return a scalar. For example, AVG(m2). Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher Metric math syntax and functions 242 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? number of data points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. To use this function with alarms, especiall y alarms that have Auto Scaling actions, we recommend that you set the alarm to use M out of N datapoints, where M < N. CEIL TS TS TS[] TS[] Returns the ceiling of each metric. The ceiling is the smallest integer greater than or equal to each value. CEIL(m1) ✓ CEIL(METRICS()) SUM(CEIL(METRICS())) Metric math syntax and functions 243 Amazon CloudWatch Function ArgumentsReturn Description Examples |
acw-ug-093 | acw-ug.pdf | 93 | type* User Guide Supported for cross- acc ount? number of data points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. To use this function with alarms, especiall y alarms that have Auto Scaling actions, we recommend that you set the alarm to use M out of N datapoints, where M < N. CEIL TS TS TS[] TS[] Returns the ceiling of each metric. The ceiling is the smallest integer greater than or equal to each value. CEIL(m1) ✓ CEIL(METRICS()) SUM(CEIL(METRICS())) Metric math syntax and functions 243 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? DATAPOINT _COUNT TS S TS[] TS Returns a count of the data points that reported values. This is useful for calculati ng averages of sparse metrics. SUM(m1) / DATAPOINT _COUNT(m1) ✓ DATAPOINT _COUNT(METRICS()) Note We recommend that you do not use this function in CloudWatc h alarms. Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than the number specified as Evaluation Periods. This function acts differently when Metric math syntax and functions 244 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? extra data is requested. Metric math syntax and functions 245 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? DB_PERF_I NSIGHTS String, String, TS (if given Returns Performan ce Insights Counter DB_PERF_INSIGHTS(‘ RDS’, ‘db-ABCDE String a metrics for databases FGHIJKLMN single such as Amazon OPQRSTUVWXY1’, string) Relational Database ‘os.cpuUtilization String, String, String[] TS[] (if given an array of strings) Service and Amazon .user.avg’) DB_PERF_INSIGHTS(‘ DOCDB, ‘db- ABCDEFGHIJKLMN OPQRSTUVWXY1’, [‘os.cpuUtilizatio n.idle.avg’, ‘os.cpuUt ilization.user.max’]) DocumentDB (with MongoDB compatibi lity). This function returns the same amount of data that you can get by directly querying the Performan ce Insights APIs. You can use these metrics in CloudWatch for graphing and creating alarms. Important When you use this function, you must specify the Unique Database Resource ID of the database. This is different than Metric math syntax and functions 246 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? the database identifier. To find the database resource ID in the Amazon RDS console, choose the DB instance to see its details. Then choose the Configura tion tab. The Resource ID is displayed in the Configuration section. DB_PERF_INSIGHTS also brings in the DBLoad metric at sub- minute intervals. Performance Insights metrics retrieved with this function are not stored in CloudWatc h. Therefore, some CloudWatch features such as cross-acc Metric math syntax and functions 247 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? ount observability, anomaly detection, metric streams, metrics explorer, and Metric Insights don't work with Performance Insights metrics that you retrieve with DB_PERF_INSIGHTS. A single request using the DB_PERF_I NSIGHTS function can retrieve the following numbers of data points. • 1080 data points for high-resolution periods (1s, 10s, 30s) • 1440 data points for standard-resolution periods (1m, 5m, 1hr, 1d) The DB_PERF_I NSIGHTS function supports only the following period lengths: • 1 second Metric math syntax and functions 248 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? • 10 seconds • 30 seconds • 1 minute • 5 minutes • 1 hour • 1 day For more information about Amazon RDS Performance Insights counter metrics, see Performance Insights counter metrics. For more informati on about Amazon DocumentDB Performance Insights counter metrics, see Performance Insights for counter metrics. Note High-resolution metrics with sub-minute granularity retrieved by DB_PERF_I Metric math syntax and functions 249 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? NSIGHTS are only applicable to the DBLoad metric, or for operating system metrics if you have enabled Enhanced Monitoring at a higher resolutio n. For more information about Amazon RDS enhanced monitoring, see Monitorin g OS metrics with Enhanced Monitoring. You can create a high-resolution alarm using the DB_PERF_I NSIGHTS function for a maximum time range of three hours. You can use the CloudWatc Metric math syntax and functions 250 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? h console to graph metrics retrieved with the DB_PERF_I NSIGHTS function for any time range. Returns the difference between each value in the time series and the preceding value from that time series. Returns the differenc e in seconds between the timestamp of each value in the time series and the timestamp of the preceding value from that time series. DIFF(m1) ✓ DIFF_TIME(METRICS()) ✓ DIFF TS TS TS[] TS[] DIFF_TIME TS TS TS[] TS[] Metric math syntax and functions 251 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* FILL TS |
acw-ug-094 | acw-ug.pdf | 94 | cross- acc ount? h console to graph metrics retrieved with the DB_PERF_I NSIGHTS function for any time range. Returns the difference between each value in the time series and the preceding value from that time series. Returns the differenc e in seconds between the timestamp of each value in the time series and the timestamp of the preceding value from that time series. DIFF(m1) ✓ DIFF_TIME(METRICS()) ✓ DIFF TS TS TS[] TS[] DIFF_TIME TS TS TS[] TS[] Metric math syntax and functions 251 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* FILL TS TS, [S | REPEAT TS[] | Fills the missing values of a time series. There are several options for the values to use as the LINEAR] filler for missing values: FILL(m1,10) FILL(METRICS(), 0) FILL(METRICS(), m1) FILL(m1, MIN(m1)) TS[], [TS | S | REPEAT | LINEAR] • You can specify a value to use as the FILL(m1, REPEAT) FILL(METRICS(), LINEAR) filler value. • You can specify a metric to use as the filler value. • You can use the REPEAT keyword to fill missing values with the most recent actual value of the metric before the missing value. • You can use the LINEAR keyword to fill the missing values with values that create a linear interpolation between the values at the beginning and the end of the gap. Metric math syntax and functions 252 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? Note When you use this function in an alarm, you can encounter an issue if your metrics are being published with a slight delay, and the most recent minute never has data. In this case, FILL replaces that missing data point with the requested value. That causes the latest data point for the metric to always be the FILL value, which can result in the alarm being stuck in either OK state or ALARM state. You can Metric math syntax and functions 253 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? work around this by using a M out of N alarm. For more information, see Evaluating an alarm. FIRST LAST TS[] TS ✓ Returns the first or last time series from an array of time series. This is useful when used with the SORT function. It can also be IF(FIRST(SORT(METR ICS(), AVG, DESC))>10 0, 1, 0) Looks at the top metric from an array, which is sorted by AVG. It then returns a 1 or used to get the high 0 for each data point, and low thresholds from the ANOMALY_D ETECTION_BAND function. FLOOR TS TS TS[] TS[] Returns the floor of each metric. The floor is the largest integer less than or equal to each value. depending on whether that data point value is more than 100. LAST(ANOM ALY_DETEC TION_BAND(m1)) returns the upper bound of the anomaly prediction band. FLOOR(m1) ✓ FLOOR(METRICS()) Metric math syntax and functions 254 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? IF TS IF expressio n Use IF along with a comparison operator For examples, see Using IF expressions. ✓ to filter out data points from a time series, or create a mixed time-series composed of multiple collated time series. For more information, see Using IF expressions. INSIGHT_R ULE_METRIC TS INSIGHT_R ULE_METRI C(ruleNam e, Use INSIGHT_R ULE_METRIC to extract statistics from a rule in Contributor Insights. metricNam For more information, LAMBDA e) TS LAMBDA(La mbdaFunct TS[] ionName [, optional- arg]*) see Graphing metrics generated by rules in CloudWatch. Calls a Lambda function to query metrics from a data source that is not CloudWatch. For more information, see How to pass arguments to your Lambda function. Metric math syntax and functions 255 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? LOG TS TS TS[] TS[] LOG10 TS TS TS[] TS[] The LOG of a time series returns the natural logarithm value of each value in the time series. The LOG10 of a time series returns the base-10 logarithm value of each value in the time series. LOG(METRICS()) ✓ LOG10(m1) ✓ Metric math syntax and functions 256 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* MAX TS S TS[] TS MAX(m1)/m1 MAX(METRICS()) The MAX of a single time series returns a scalar representing the maximum value of all data points in the metric. If you input an array of time series, the MAX function creates and returns a time series that consists of the highest value for each data point, among the time series that were used as the input. Note We recommend that you do not use this function in CloudWatc h alarms if you want the function to return a |
acw-ug-095 | acw-ug.pdf | 95 | Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* MAX TS S TS[] TS MAX(m1)/m1 MAX(METRICS()) The MAX of a single time series returns a scalar representing the maximum value of all data points in the metric. If you input an array of time series, the MAX function creates and returns a time series that consists of the highest value for each data point, among the time series that were used as the input. Note We recommend that you do not use this function in CloudWatc h alarms if you want the function to return a scalar. For example, MAX(m2) Whenever an Metric math syntax and functions 257 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. METRIC_CO UNT TS[] S Returns the number of metrics in the time m1/METRIC _COUNT(METRICS()) ✓ series array. Metric math syntax and functions 258 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? METRICS null TS[] string AVG(METRICS()) ✓ SUM(METRICS("error s")) The METRICS() function returns all CloudWatch metrics in the request. Math expressions aren't included. You can use METRICS() within a larger expression that produces a single time series or an array of time series. You can use the METRICS() function with a string to return only the graphed metrics that contain that string in their Id field. For example, the expression SUM(METRI CS("errors")) returns a time series that is the sum of the values of all the graphed metrics that have ‘errors’ in their Id field. You can also use SUM([METR ICS(“4xx”), METRICS(“ 5xx”)]) to match multiple strings. Metric math syntax and functions 259 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* MIN TS S TS[] TS m1-MIN(m1) MIN(METRICS()) The MIN of a single time series returns a scalar representing the minimum value of all data points in the metric. If you input an array of time series, the MIN function creates and returns a time series that consists of the lowest value for each data point, among the time series that were used as the input. If you input an array of time series, the MIN function creates and returns a time series that consists of the lowest value for each data point, among the time series that were used as the input. Note We recommend that you do Metric math syntax and functions 260 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? not use this function in CloudWatc h alarms if you want the function to return a scalar. For example, MIN(m2) Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. Metric math syntax and functions 261 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* MINUTE TS TS HOUR DAY DATE MONTH YEAR EPOCH MINUTE(m1) IF(DAY(m1)<6,m1) returns metrics only from weekdays, Monday to Friday. IF(MONTH(m1) == 4,m1) returns only metrics published in April. These functions take the period and range of the time series and return a new non-spars e time series where each value is based on its timestamp. • MINUTE returns a non-sparse time series of integers between 0 and 59 that represent the UTC minute of each timestamp in the original time series. • HOUR returns a non- sparse time series of integers between 0 and 23 that represent the UTC hour of each timestamp in the original time series. • DAY returns a non- sparse time series of integers between 1 and 7 that represent the UTC day of the week of each timestamp in the Metric math syntax and functions 262 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? original time series. 1 represents Monday and 7 represents Sunday. • DATE returns a non- sparse time series of integers between 1 and 31 that represent the UTC day of the month of each timestamp in the original time series. • MONTH returns a non-sparse time series of integers between 1 and 12 that represent the UTC month of each timestamp in the original time series. 1 represents January and 12 represents December. • YEAR returns a non-sparse time series of integers that represent the UTC year of each timestamp in the original time series. Metric math syntax and functions 263 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? • EPOCH returns a non-sparse |
acw-ug-096 | acw-ug.pdf | 96 | between 1 and 31 that represent the UTC day of the month of each timestamp in the original time series. • MONTH returns a non-sparse time series of integers between 1 and 12 that represent the UTC month of each timestamp in the original time series. 1 represents January and 12 represents December. • YEAR returns a non-sparse time series of integers that represent the UTC year of each timestamp in the original time series. Metric math syntax and functions 263 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? • EPOCH returns a non-sparse time series of integers that represent the UTC time in seconds since the Epoch of each timestamp in the original time series. The Epoch is January 1, 1970. Returns the period of the metric in seconds. Valid input is metrics, not the results of other expressions. m1/PERIOD(m1) ✓ PERIOD TS S Metric math syntax and functions 264 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* RATE TS TS TS[] TS[] RATE(m1) RATE(METRICS()) Returns the rate of change of the metric per second. This is calculated as the difference between the latest data point value and the previous data point value, divided by the time difference in seconds between the two values. Important Setting alarms on expressio ns that use the RATE function on metrics with sparse data can behave unpredictably, because the range of data points fetched when evaluatin g the alarm can vary based on when the data Metric math syntax and functions 265 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? points were last published. Metric math syntax and functions 266 Amazon CloudWatch Function ArgumentsReturn Description Examples type* REMOVE_EM PTY TS[] TS[] Removes any time series that have no data REMOVE_EM PTY(METRICS()) User Guide Supported for cross- acc ount? ✓ points from an array of time series. The result is an array of time series where each time series contains at least one data point. Note We recommend that you do not use this function in CloudWatc h alarms. Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than the number specified as Evaluation Periods. This function acts Metric math syntax and functions 267 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? differently when extra data is requested. Metric math syntax and functions 268 Amazon CloudWatch Function ArgumentsReturn Description Examples type* RUNNING_S UM TS TS TS[] TS[] Returns a time series with the running sum RUNNING_S UM([m1,m2]) of the values in the original time series. User Guide Supported for cross- acc ount? ✓ Note We recommend that you do not use this function in CloudWatc h alarms. Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. Metric math syntax and functions 269 Amazon CloudWatch Function ArgumentsReturn Description Examples type* SEARCH Search expressio One or Returns one or more time series that match a User Guide Supported for cross- acc ount? ✓ n more TS search criteria that you specify. The SEARCH function enables you to add multiple related time series to a graph with one expression. The graph is dynamical ly updated to include new metrics that are added later and match the search criteria. For more information, see Use search expressions in graphs. You can't create an alarm based on a SEARCH expression. This is because search expressions return multiple time series, and an alarm based on a math expression can watch only one time series. If you are signed in to a monitoring account in CloudWatch cross- Metric math syntax and functions 270 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* SERVICE_Q UOTA TS TS that is a usage metric account observability, the SEARCH function finds metrics in the source accounts and the monitoring account. Returns the service quota for the given usage metric. You can use this to visualize how your current usage compares to the quota, and to set alarms that warn you when you approach the quota. For more information, see AWS usage metrics. Metric math syntax and functions 271 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* SLICE TS[] TS (TS[], S, S) or (TS[], S) Retrieves part of an array of time series. This is especially useful when combined with SORT. For example, you can exclude the top SLICE(SORT(METRICS (), SUM, DESC), 0, 10) returns the 10 metrics from the array of metrics in the request that have the highest result from an array |
acw-ug-097 | acw-ug.pdf | 97 | the quota, and to set alarms that warn you when you approach the quota. For more information, see AWS usage metrics. Metric math syntax and functions 271 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* SLICE TS[] TS (TS[], S, S) or (TS[], S) Retrieves part of an array of time series. This is especially useful when combined with SORT. For example, you can exclude the top SLICE(SORT(METRICS (), SUM, DESC), 0, 10) returns the 10 metrics from the array of metrics in the request that have the highest result from an array of SUM value. time series. You can use two scalar arguments to define the SLICE(SORT(METRICS (), AVG, ASC), 5) sorts the array of metrics by set of time series that the AVG statistic, then you want returned. The returns all the time two scalars define the start (inclusive) and end series except for the 5 with the lowest AVG. (exclusive) of the array to return. The array is zero-indexed, so the first time series in the array is time series 0. Alternatively, you can specify just one value, and CloudWatch returns all time series starting with that value. Metric math syntax and functions 272 User Guide Supported for cross- acc ount? ✓ Amazon CloudWatch Function ArgumentsReturn Description Examples type* SORT(METRICS(), AVG, DESC, 10) calculates the average value of each time series, sorts the time series with the highest values at the beginning of the sort, and returns only the 10 time series with the highest averages. SORT(METRICS(), MAX, ASC) sorts the array of metrics by the MAX statistic, then returns all of them in ascending order. SORT TS[] (TS[], FUNCTION, Sorts an array of time series according to the SORT_ORDE function you specify. R) (TS[], FUNCTION, SORT_ORDE R, S) The function you use can be AVG, MIN, MAX, or SUM. The sort order can be either ASC for ascending (lowest values first) or DESC to sort the higher values first. You can optionall y specify a number after the sort order which acts as a limit. For example, specifying a limit of 5 returns only the top 5 time series from the sort. When this math function is displayed on a graph, the labels for each metric in the graph are also sorted and numbered. Metric math syntax and functions 273 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? STDDEV TS S TS[] TS m1/STDDEV(m1) ✓ STDDEV(METRICS()) The STDDEV of a single time series returns a scalar representing the standard deviation of all data points in the metric. The STDDEV of an array of time series returns a single time series. Note We recommend that you do not use this function in CloudWatc h alarms if you want the function to return a scalar. For example, STDDEV(m2) Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data Metric math syntax and functions 274 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. Metric math syntax and functions 275 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? SUM TS S TS[] TS The SUM of a single time series returns a SUM(METRICS())/SUM (m1) ✓ scalar representing the sum of the values of all data points in the metric. The SUM of an array of time series returns a single time series. SUM([m1,m2]) SUM(METRICS("error s"))/SUM(METRICS(" requests"))*100 Note We recommend that you do not use this function in CloudWatc h alarms if you want the function to return a scalar. For example, SUM(m1). Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data Metric math syntax and functions 276 Amazon CloudWatch Function ArgumentsReturn Description Examples type* User Guide Supported for cross- acc ount? points than the number specified as Evaluation Periods. This function acts differently when extra data is requested. TIME_SERIES S TS Returns a non-sparse time series where every TIME_SERIES(MAX(m1 )) ✓ value is set to a scalar argument. TIME_SERIES(5*AVG( m1)) TIME_SERIES(10) *Using a function that returns only a scalar number is not valid, as all final results of expressions must be a single time series or an array of time series. Instead, use these functions as part of a larger expression that returns a time series. Using IF expressions Use IF along with a comparison operator to filter out data points from a time series, or create a mixed time-series composed of multiple collated time series. IF uses the following arguments: IF(condition, trueValue, falseValue) Using IF expressions 277 Amazon CloudWatch User Guide The condition evaluates to FALSE if the value of the condition |
acw-ug-098 | acw-ug.pdf | 98 | function that returns only a scalar number is not valid, as all final results of expressions must be a single time series or an array of time series. Instead, use these functions as part of a larger expression that returns a time series. Using IF expressions Use IF along with a comparison operator to filter out data points from a time series, or create a mixed time-series composed of multiple collated time series. IF uses the following arguments: IF(condition, trueValue, falseValue) Using IF expressions 277 Amazon CloudWatch User Guide The condition evaluates to FALSE if the value of the condition data point is 0, and to TRUE if the value of the condition is any other value, whether that value is positive or negative. If the condition is a time series, it is evaluated separately for every timestamp. The following lists the valid syntax’s. For each of these syntax’s, the output is a single time series. • IF(TS Comparison Operator S, S | TS, S | TS) Note If the TS comparison operator S is TRUE but metric2 doesn't have a corresponding data point, the output will be 0. • IF(TS, TS, TS) • IF(TS, S, TS) • IF(TS, TS, S) • IF(TS, S, S) • IF(S, TS, TS) The following sections provide more details and examples for these syntax’s. IF(TS Comparison Operator S, scalar2 | metric2, scalar3 | metric3) The corresponding output time series value: • has the value of scalar2 or metric2, if TS Comparison Operator S is TRUE • has the value of scalar3 or metric3, if TS Comparison Operator S is FALSE • has the value of 0 if the TS Comparison Operator is TRUE and the corresponding data point in metric2 doesn't exist. • has the value of 0 if the TS Comparison Operator is FALSE and the corresponding data point in metric3 doesn't exist. • is an empty time series, if the corresponding data point of does not exist in metric3, or if scalar3/metric3 is omitted from the expression IF(metric1, metric2, metric3) For each data point of metric1, the corresponding output time series value: Using IF expressions 278 Amazon CloudWatch User Guide • has the value of metric2, if the corresponding data point of metric1 is TRUE. • has the value of metric3, if the corresponding data point of metric1 is FALSE. • has the value of 0, if the corresponding data point of metric1 is TRUE and the corresponding data point does not exist in metric2. • is dropped, if the corresponding data point of metric1 is FALSE and the corresponding data point does not exist in metric3 • is dropped, if the corresponding data point of metric1 is FALSE and metric3 is omitted from the expression. • is dropped, if the corresponding data point of metric1 is missing. The following table shows an example for this syntax. Metric or function (metric1) (metric2) (metric3) Values [1, 1, 0, 0, -] [30, -, 0, 0, 30] [0, 0, 20, -, 20] IF(metric1, metric2, metric3) [30, 0, 20, 0, -] IF(metric1, scalar2, metric3) For each data point of metric1, the corresponding output time series value: • has the value of scalar2, if the corresponding data point of metric1 is TRUE. • has the value of metric3, if the corresponding data point of metric1 is FALSE. • is dropped, if the corresponding data point of metric1 is FALSE and the corresponding data point does not exist on metric3, or if metric3 is omitted from the expression. Metric or function (metric1) Using IF expressions Values [1, 1, 0, 0, -] 279 Amazon CloudWatch Metric or function scalar2 (metric3) Values 5 [0, 0, 20, -, 20] IF(metric1, scalar2, metric3) [5, 5, 20, -, -] User Guide IF(metric1, metric2, scalar3) For each data point of metric1, the corresponding output time series value: • has the value of metric2, if the corresponding data point of metric1 is TRUE. • has the value of scalar3, if the corresponding data point of metric1 is FALSE. • has the value of 0, if the corresponding data point of metric1 is TRUE and the corresponding data point does not exist in metric2. • is dropped if the corresponding data point in metric1 does not exist. Metric or function (metric1) (metric2) scalar3 Values [1, 1, 0, 0, -] [30, -, 0, 0, 30] 5 IF(metric1, metric2, scalar3) [30, 0, 5, 5, -] IF(scalar1, metric2, metric3) The corresponding output time series value: • has the value of metric2, if scalar1 is TRUE. • has the value of metric3, if scalar1 is FALSE. • is an empty time series, if metric3 is omitted from the expression. Using IF expressions 280 Amazon CloudWatch User Guide Use case examples for IF expressions The following examples illustrate the possible uses of the IF function. • To display only the low |
acw-ug-099 | acw-ug.pdf | 99 | exist. Metric or function (metric1) (metric2) scalar3 Values [1, 1, 0, 0, -] [30, -, 0, 0, 30] 5 IF(metric1, metric2, scalar3) [30, 0, 5, 5, -] IF(scalar1, metric2, metric3) The corresponding output time series value: • has the value of metric2, if scalar1 is TRUE. • has the value of metric3, if scalar1 is FALSE. • is an empty time series, if metric3 is omitted from the expression. Using IF expressions 280 Amazon CloudWatch User Guide Use case examples for IF expressions The following examples illustrate the possible uses of the IF function. • To display only the low values of a metric: IF(metric1<400, metric1) • To change each data point in a metric to one of two values, to show relative highs and lows of the original metric: IF(metric1<400, 10, 2) • To display a 1 for each timestamp where latency is over the threshold, and display a 0 for all other data points: IF(latency>threshold, 1, 0) Use metric math with the GetMetricData API operation You can use GetMetricData to perform calculations using math expressions, and also retrieve large batches of metric data in one API call. For more information, see GetMetricData. Anomaly detection on metric math Anomaly detection on metric math is a feature that you can use to create anomaly detection alarms on single metrics and the outputs of metric math expressions. You can use these expressions to create graphs that visualize anomaly detection bands. The feature supports basic arithmetic functions, comparison and logical operators, and most other functions. Anomaly detection on metric math doesn't support the following functions: • Expressions that contain more than one ANOMALY_DETECTION_BAND in the same line. • Expressions that contain more than 10 metrics or math expressions. • Expressions that contain the METRICS expression. • Expressions that contain the SEARCH function. • Expressions that use the DP_PERF_INSIGHTS function. • Expressions that use metrics with different periods. • Expressions that use periods longer than one hour as input. Anomaly detection on metric math 281 Amazon CloudWatch User Guide • Expressions that use high-resolution metrics as input. For more information about this feature, see Using CloudWatch anomaly detection in the Amazon CloudWatch User Guide. Use search expressions in graphs Search expressions are a type of math expression that you can add to CloudWatch graphs. Search expressions enable you to quickly add multiple related metrics to a graph. They also enable you to create dynamic graphs that automatically add appropriate metrics to their display, even if those metrics don't exist when you first create the graph. For example, you can create a search expression that displays the AWS/EC2 CPUUtilization metric for all instances in the Region. If you later launch a new instance, the CPUUtilization of the new instance is automatically added to the graph. When you use a search expression in a graph, the search finds the search expression in metric names, namespaces, dimension names, and dimension values. You can use Boolean operators for more complex and powerful searches. A search expression can find only metrics that have reported data within the past two weeks. You can't create an alarm based on the SEARCH expression. This is because search expressions return multiple time series, and an alarm based on a math expression can watch only one time series. If you are using a monitoring account in CloudWatch cross-account observability, your search expressions can find metrics in the source accounts linked to that monitoring account. Topics • CloudWatch search expression syntax • CloudWatch search expression examples • Create a CloudWatch graph with a search expression CloudWatch search expression syntax A valid search expression has the following format. Use search expressions in graphs 282 Amazon CloudWatch User Guide SEARCH(' {Namespace, DimensionName1, DimensionName2, ...} SearchTerm', 'Statistic') For example: SEARCH('{AWS/EC2,InstanceId} MetricName="CPUUtilization"', 'Average') • The first part of the query after the word SEARCH, enclosed in curly braces, is the metric schema to be searched. The metric schema contains a metric namespace and one or more dimension names. Including a metric schema in a search query is optional. If specified, the metric schema must contain a namespace and can optionally contain one or more dimension names that are valid in that namespace. You don't need to use quote marks inside the metric schema unless a namespace or dimension name includes spaces or non-alphanumeric characters. In that case, you must enclose the name that contains those characters with double quotes. • The SearchTerm is also optional, but a valid search must contain either the metric schema, the SearchTerm, or both. The SearchTerm usually contains one or more account IDs, metric names or dimension values. The SearchTerm can include multiple terms to search for, by both partial match and exact match. It can also contain Boolean operators. Using an account ID in a SearchTerm works only in accounts that are |
acw-ug-100 | acw-ug.pdf | 100 | marks inside the metric schema unless a namespace or dimension name includes spaces or non-alphanumeric characters. In that case, you must enclose the name that contains those characters with double quotes. • The SearchTerm is also optional, but a valid search must contain either the metric schema, the SearchTerm, or both. The SearchTerm usually contains one or more account IDs, metric names or dimension values. The SearchTerm can include multiple terms to search for, by both partial match and exact match. It can also contain Boolean operators. Using an account ID in a SearchTerm works only in accounts that are set up as monitoring accounts for CloudWatch cross-account observability. The syntax for an account ID in SearchTerm is :aws.AccountId = 444455556666. You can also use 'LOCAL' to specify the monitoring account itself: :aws.AccountId = 'LOCAL' For more information, see CloudWatch cross-account observability. The SearchTerm can include one or more designators, such as MetricName= as in this example, but using designators isn't required. The metric schema and SearchTerm must be enclosed together in a pair of single quote marks. • The Statistic is the name of any valid CloudWatch statistic. It must be enclosed by single quotes. For more information, see Statistics. The preceding example searches the AWS/EC2 namespace for any metrics that have InstanceId as a dimension name. It returns all CPUUtilization metrics that it finds, with the graph showing the Average statistic. Search expression syntax 283 Amazon CloudWatch User Guide A search expression can find only metrics that have reported data within the past two weeks. Search expression limits The maximum search expression query size is 1024 characters. You can have as many as 100 search expressions on one graph. A graph can display as many as 500 time series. CloudWatch search expressions: Tokenization When you specify a SearchTerm, the search function searches for tokens, which are substrings that CloudWatch automatically generates from full metric names, dimension names, dimension values, and namespaces. CloudWatch generates tokens distinguished by the camel-case capitalization in the original string. Numeric characters also serve as the start of new tokens, and non-alphanumeric characters serve as delimiters, creating tokens before and after the non- alphanumeric characters. A continuous string of the same type of token delimiter character results in one token. All generated tokens are in lowercase. The following table shows some examples of tokens generated. Original string Tokens generated CustomCount1 customcount1 , custom, count, 1 SDBFailure sdbfailure , sdb, failure Project2-trial333 project2trial333 , project, 2, trial, 333 CloudWatch search expressions: Partial matches When you specify a SearchTerm, the search term is also tokenized. CloudWatch finds metrics based on partial matches, which are matches of a single token generated from the search term to a single token generated from a metric name, namespace, dimension name, or dimension value. Partial match searches to match a single token are case insensitive. For example, using any of the following search terms can return the CustomCount1 metric: • count Search expression syntax 284 Amazon CloudWatch • Count • COUNT User Guide However, using couNT as a search term doesn't find CustomCount1 because the capitalization in the search term couNT is tokenized into cou and NT. Searches can also match composite tokens, which are multiple tokens that appear consecutively in the original name. To match a composite token, the search is case sensitive. For example, if the original term is CustomCount1, searches for CustomCount or Count1 are successful, but searches for customcount or count1 aren't. CloudWatch search expressions: Exact matches You can define a search to find only exact matches of your search term by using double quotes around the part of the search term that requires an exact match. These double- quotes are enclosed in the single-quotes used around the entire search term. For example, SEARCH(' {MyNamespace}, "CustomCount1" ', 'Maximum') finds the exact string CustomCount1 if it exists as a metric name, dimension name, or dimension value in the namespace named MyNamespace. However, the searches SEARCH(' {MyNamespace}, "customcount1" ', 'Maximum') or SEARCH(' {MyNamespace}, "Custom" ', 'Maximum') do not find this string. You can combine partial match terms and exact match terms in a single search expression. For example, SEARCH(' {AWS/NetworkELB, LoadBalancer} "ConsumedLCUs" OR flow ', 'Maximum') returns the Elastic Load Balancing metric named ConsumedLCUs as well as all Elastic Load Balancing metrics or dimensions that contain the token flow. Using exact match is also a good way to find names with special characters, such as non- alphanumeric characters or spaces, as in the following example. SEARCH(' {"My Namespace", "Dimension@Name"}, "Custom:Name[Special_Characters" ', 'Maximum') CloudWatch search expressions: Excluding a metric schema All examples shown so far include a metric schema, in curly braces. Searches that omit a metric schema are also valid. Search expression syntax 285 Amazon CloudWatch User Guide For example, SEARCH(' "CPUUtilization" ', 'Average') returns all metric names, dimension names, |
acw-ug-101 | acw-ug.pdf | 101 | Balancing metric named ConsumedLCUs as well as all Elastic Load Balancing metrics or dimensions that contain the token flow. Using exact match is also a good way to find names with special characters, such as non- alphanumeric characters or spaces, as in the following example. SEARCH(' {"My Namespace", "Dimension@Name"}, "Custom:Name[Special_Characters" ', 'Maximum') CloudWatch search expressions: Excluding a metric schema All examples shown so far include a metric schema, in curly braces. Searches that omit a metric schema are also valid. Search expression syntax 285 Amazon CloudWatch User Guide For example, SEARCH(' "CPUUtilization" ', 'Average') returns all metric names, dimension names, dimension values, and namespaces that are an exact match for the string CPUUtilization. In the AWS metric namespaces, this can include metrics from several services including Amazon EC2, Amazon ECS, SageMaker AI, and others. To narrow this search to only one AWS service, the best practice is to specify the namespace and any necessary dimensions in the metric schema, as in the following example. Although this narrows the search to the AWS/EC2 namespace, it would still return results of other metrics if you have defined CPUUtilization as a dimension value for those metrics. SEARCH(' {AWS/EC2, InstanceType} "CPUUtilization" ', 'Average') Alternatively you could add the namespace in the SearchTerm as in the following example. But in this example, the search would match any AWS/EC2 string, even if it was a custom dimension name or value. SEARCH(' "AWS/EC2" MetricName="CPUUtilization" ', 'Average') CloudWatch search expressions: Specifying property names in the search The following exact match search for "CustomCount1" returns all metrics with exactly that name. SEARCH(' "CustomCount1" ', 'Maximum') But it also returns metrics with dimension names, dimension values, or namespaces of CustomCount1. To structure your search further, you can specify the property name of the type of object that you want to find in your searches. The following example searches all namespaces and returns metrics named CustomCount1. SEARCH(' MetricName="CustomCount1" ', 'Maximum') You can also use namespaces and dimension name/value pairs as property names, as in the following examples. The first of these examples also illustrates that you can use property names with partial match searches as well. SEARCH(' InstanceType=micro ', 'Average') SEARCH(' InstanceType="t2.micro" Namespace="AWS/EC2" ', 'Average') Search expression syntax 286 Amazon CloudWatch User Guide CloudWatch search expressions: Non-alphanumeric characters Non-alphanumeric characters serve as delimiters, and mark where the names of metrics, dimensions, namespaces, and search terms are to be separated into tokens. When terms are tokenized, non-alphanumeric characters are stripped out and don't appear in the tokens. For example, Network-Errors_2 generates the tokens network, errors, and 2. Your search term can include any non-alphanumeric characters. If these characters appear in your search term, they can specify composite tokens in a partial match. For example, all of the following searches would find metrics named either Network-Errors-2 or NetworkErrors2. network/errors network+errors network-errors Network_Errors When you're doing an exact value search, any non-alphanumeric characters used in the exact search must be the correct characters that appear in the string being searched for. For example, if you want to find Network-Errors-2, searching for "Network-Errors-2" is successful, but a search for "Network_Errors_2" isn't. When you perform an exact match search, the following characters must be escaped with a backslash. " \ ( ) For example, to find the metric name Europe\France Traffic(Network) by exact match, use the search term "Europe\\France Traffic\(Network\)" CloudWatch search expressions: Boolean operators Search supports the use of the Boolean operators AND, OR, and NOT within the SearchTerm. Boolean operators are enclosed in the single quote marks that you use to enclose the entire search term. Boolean operators are case sensitive, so and, or, and not aren't valid as Boolean operators. You can use AND explicitly in your search, such as SEARCH('{AWS/EC2,InstanceId} network AND packets', 'Average'). Not using any Boolean operator between search terms implicitly searches them as if there were an AND operator, so SEARCH(' {AWS/EC2,InstanceId} network packets ', 'Average') yields the same search results. Search expression syntax 287 Amazon CloudWatch User Guide Use NOT to exclude subsets of data from the results. For example, SEARCH(' {AWS/ EC2,InstanceId} MetricName="CPUUtilization" NOT i-1234567890123456 ', 'Average') returns the CPUUtilization for all your instances, except for the instance i-1234567890123456. You can also use a NOT clause as the only search term. For example, SEARCH( 'NOT Namespace=AWS ', 'Maximum') yields all your custom metrics (metrics with namespaces that don't include AWS). You can use multiple NOT phrases in a query. For example, SEARCH(' {AWS/EC2,InstanceId} MetricName="CPUUtilization" NOT "ProjectA" NOT "ProjectB" ', 'Average') returns the CPUUtilization of all instances in the Region, except for those with dimension values of ProjectA or ProjectB. You can combine Boolean operators for more powerful and detailed searches, as in the following examples. Use parentheses to group the operators. Both of the next two examples return all metric names containing ReadOps from both the EC2 |
acw-ug-102 | acw-ug.pdf | 102 | the only search term. For example, SEARCH( 'NOT Namespace=AWS ', 'Maximum') yields all your custom metrics (metrics with namespaces that don't include AWS). You can use multiple NOT phrases in a query. For example, SEARCH(' {AWS/EC2,InstanceId} MetricName="CPUUtilization" NOT "ProjectA" NOT "ProjectB" ', 'Average') returns the CPUUtilization of all instances in the Region, except for those with dimension values of ProjectA or ProjectB. You can combine Boolean operators for more powerful and detailed searches, as in the following examples. Use parentheses to group the operators. Both of the next two examples return all metric names containing ReadOps from both the EC2 and EBS namespaces. SEARCH(' (EC2 OR EBS) AND MetricName=ReadOps ', 'Maximum') SEARCH(' (EC2 OR EBS) MetricName=ReadOps ', 'Maximum') The following example narrows the previous search to only results that include ProjectA, which could be the value of a dimension. SEARCH(' (EC2 OR EBS) AND ReadOps AND ProjectA ', 'Maximum') The following example uses nested grouping. It returns Lambda metrics for Errors from all functions, and Invocations of functions with names that include the strings ProjectA or ProjectB. SEARCH(' {AWS/Lambda,FunctionName} MetricName="Errors" OR (MetricName="Invocations" AND (ProjectA OR ProjectB)) ', 'Average') CloudWatch search expressions: Using math expressions You can use a search expression within a math expressions in a graph. Search expression syntax 288 Amazon CloudWatch User Guide For example, SUM(SEARCH(' {AWS/Lambda, FunctionName} MetricName="Errors" ', 'Sum')) returns the sum of the Errors metric of all your Lambda functions. Using separate lines for your search expression and math expression might yield more useful results. For example, suppose that you use the following two expressions in a graph. The first line displays separate Errors lines for each of your Lambda functions. The ID of this expression is e1. The second line adds another line showing the sum of the errors from all of the functions. SEARCH(' {AWS/Lambda, FunctionName}, MetricName="Errors" ', 'Sum') SUM(e1) CloudWatch search expression examples The following examples illustrate more search expression uses and syntax. Let's start with a search for CPUUtilization across all instances in the Region and then look at variations. This example displays one line for each instance in the Region, showing the CPUUtilization metric from the AWS/EC2 namespace. SEARCH(' {AWS/EC2,InstanceId} MetricName="CPUUtilization" ', 'Average') Changing InstanceId to InstanceType changes the graph to show one line for each instance type used in the Region. Data from all instances of each type is aggregated into one line for that instance type. SEARCH(' {AWS/EC2,InstanceType} MetricName="CPUUtilization" ', 'Average') The following example aggregates the CPUUtilization by instance type and displays one line for each instance type that includes the string micro. SEARCH('{AWS/EC2,InstanceType} InstanceType=micro MetricName="CPUUtilization" ', 'Average') This example narrows the previous example, changing the InstanceType to an exact search for t2.micro instances. SEARCH('{AWS/EC2,InstanceType} InstanceType="t2.micro" MetricName="CPUUtilization" ', 'Average') Search expression examples 289 Amazon CloudWatch User Guide The following search removes the {metric schema} part of the query, so the CPUUtilization metric from all namespaces appears in the graph. This can return quite a few results because the graph includes multiple lines for the CPUUtilization metric from each AWS service, aggregated along different dimensions. SEARCH('MetricName="CPUUtilization" ', 'Average') To narrow these results a bit, you can specify two specific metric namespaces. SEARCH('MetricName="CPUUtilization" AND ("AWS/ECS" OR "AWS/ES") ', 'Average') The preceding example is the only way to do a search of specific multiple namespaces with one search query, as you can specify only one metric schema in each query. However, to add more structure, you could use two queries in the graph, as in the following example. This example also adds more structure by specifying a dimension to use to aggregate the data for Amazon ECS. SEARCH('{AWS/ECS ClusterName}, MetricName="CPUUtilization" ', 'Average') SEARCH(' {AWS/EBS} MetricName="CPUUtilization" ', 'Average') The following example returns the Elastic Load Balancing metric named ConsumedLCUs as well as all Elastic Load Balancing metrics or dimensions that contain the token flow. SEARCH('{AWS/NetworkELB, LoadBalancer} "ConsumedLCUs" OR flow ', 'Maximum') The following example uses nested grouping. It returns Lambda metrics for Errors from all functions and Invocations of functions with names that include the strings ProjectA or ProjectB. SEARCH('{AWS/Lambda,FunctionName} MetricName="Errors" OR (MetricName="Invocations" AND (ProjectA OR ProjectB)) ', 'Average') The following example displays all of your custom metrics, excluding metrics generated by AWS services. SEARCH('NOT Namespace=AWS ', 'Average') The following example displays metrics with metric names, namespaces, dimension names, and dimension values that contain the string Errors as part of their name. Search expression examples 290 Amazon CloudWatch User Guide SEARCH('Errors', 'Average') The following example narrows that search to exact matches. For example, this search finds the metric name Errors but not metrics named ConnectionErrors or errors. SEARCH(' "Errors" ', 'Average') The following example shows how to specify names that contain spaces or special characters in the metric schema part of the search term. SEARCH('{"Custom-Namespace", "Dimension Name With Spaces"}, ErrorCount ', 'Maximum') CloudWatch cross-account observability search expression examples CloudWatch cross-account observability examples |
acw-ug-103 | acw-ug.pdf | 103 | metrics with metric names, namespaces, dimension names, and dimension values that contain the string Errors as part of their name. Search expression examples 290 Amazon CloudWatch User Guide SEARCH('Errors', 'Average') The following example narrows that search to exact matches. For example, this search finds the metric name Errors but not metrics named ConnectionErrors or errors. SEARCH(' "Errors" ', 'Average') The following example shows how to specify names that contain spaces or special characters in the metric schema part of the search term. SEARCH('{"Custom-Namespace", "Dimension Name With Spaces"}, ErrorCount ', 'Maximum') CloudWatch cross-account observability search expression examples CloudWatch cross-account observability examples If you are signed in to an account that is set up as a monitoring account in CloudWatch cross- account observability, you can use the SEARCH function to return metrics from specified source accounts. For more information, see CloudWatch cross-account observability. The following example retrieves all Lambda metrics from the account with the account ID 111122223333. SEARCH(' AWS/Lambda :aws.AccountId = 111122223333 ', 'Average') The following example retrieves all AWS/EC2 metrics from two accounts: 111122223333 and 777788889999. SEARCH(' AWS/EC2 :aws.AccountId = (111122223333 OR 777788889999) ', 'Average') The following example retrieves all AWS/EC2 metrics from the source account 111122223333 and from the monitoring account itself. SEARCH(' AWS/EC2 :aws.AccountId = (111122223333 OR 'LOCAL') ', 'Average') The following example retrieves the SUM of the MetaDataToken metric from the account 444455556666 with the InstanceId dimension. Search expression examples 291 Amazon CloudWatch User Guide SEARCH('{AWS/EC2,InstanceId} :aws.AccountId=444455556666 MetricName=\"MetadataNoToken \"','Sum') Create a CloudWatch graph with a search expression On the CloudWatch console, you can access search capability when you add a graph to a dashboard, or by using the Metrics view. You can't create an alarm based on a SEARCH expression. This is because search expressions return multiple time series, and an alarm based on a math expression can watch only one time series. To add a graph with a search expression to an existing dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards and select a dashboard. 3. Choose Add widget. 4. Choose either Line or Stacked area and choose Configure. 5. On the Graphed metrics tab, choose Add a math expression. 6. 7. For Details, enter the search expression that you want. For example, SEARCH('{AWS/ EC2,InstanceId} MetricName="CPUUtilization"', 'Average') (Optional) To add another search expression or math expression to the graph, choose Add a math expression 8. (Optional) After you add a search expression, you can specify a dynamic label to appear on the graph legend for each metric. Dynamic labels display a statistic about the metric and automatically update when the dashboard or graph is refreshed. To add a dynamic label, choose Graphed metrics and then Dynamic labels. By default, the dynamic values you add to the label appear at the beginning of the label. You can then click the Label value for the metric to edit the label. For more information, see Use dynamic labels. 9. (Optional) To add a single metric to the graph, choose the All metrics tab and drill down to the metric you want. 10. (Optional) To change the time range shown on the graph, choose either custom at the top of the graph or one of the time periods to the left of custom. Creating a graph with a search expression 292 Amazon CloudWatch User Guide 11. (Optional) Horizontal annotations help dashboard users quickly see when a metric has spiked to a certain level or whether the metric is within a predefined range. To add a horizontal annotation, choose Graph options and then Add horizontal annotation: a. b. c. d. For Label, enter a label for the annotation. For Value, enter the metric value where the horizontal annotation appears. For Fill, specify whether to use fill shading with this annotation. For example, choose Above or Below for the corresponding area to be filled. If you specify Between, another Value field appears, and the area of the graph between the two values is filled. For Axis, specify whether the numbers in Value refer to the metric associated with the left y-axis or the right y-axis if the graph includes multiple metrics. You can change the fill color of an annotation by choosing the color square in the left column of the annotation. Repeat these steps to add multiple horizontal annotations to the same graph. To hide an annotation, clear the check box in the left column for that annotation. To delete an annotation, choose x in the Actions column. 12. (Optional) Vertical annotations help you mark milestones in a graph, such as operational events or the beginning and end of a deployment. To add a vertical annotation, choose Graph options and then Add vertical annotation: a. b. c. For Label, enter a label for the annotation. To show only the date and time on the |
acw-ug-104 | acw-ug.pdf | 104 | in the left column of the annotation. Repeat these steps to add multiple horizontal annotations to the same graph. To hide an annotation, clear the check box in the left column for that annotation. To delete an annotation, choose x in the Actions column. 12. (Optional) Vertical annotations help you mark milestones in a graph, such as operational events or the beginning and end of a deployment. To add a vertical annotation, choose Graph options and then Add vertical annotation: a. b. c. For Label, enter a label for the annotation. To show only the date and time on the annotation, keep the Label field blank. For Date, specify the date and time where the vertical annotation appears. For Fill, specify whether to use fill shading before or after a vertical annotation or between two vertical annotations. For example, choose Before or After for the corresponding area to be filled. If you specify Between, another Date field appears, and the area of the graph between the two values is filled. Repeat these steps to add multiple vertical annotations to the same graph. To hide an annotation, clear the check box in the left column for that annotation. To delete an annotation, choose x in the Actions column. Creating a graph with a search expression 293 Amazon CloudWatch 13. Choose Create widget. 14. Choose Save dashboard. User Guide To use the Metrics view to graph searched metrics 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, All metrics. In the search field, enter the tokens to search for: for example, cpuutilization t2.small. Results that match your search appear. 4. To graph all of the metrics that match your search, choose Graph search. or To refine your search, choose one of the namespaces that appeared in your search results. 5. If you selected a namespace to narrow your results, you can do the following: a. To graph one or more metrics, select the check box next to each metric. To select all metrics, select the check box in the heading row of the table. b. To refine your search, hover over a metric name and choose Add to search or Search for this only. c. To view help for a metric, select the metric name and choose What is this?. The selected metrics appear on the graph. 6. 7. (Optional) Select one of the buttons in the search bar to edit that part of the search term. (Optional) To add the graph to a dashboard, choose Actions and then Add to dashboard. Get statistics for a metric CloudWatch statistics definitions Statistics are metric data aggregations over specified periods of time. When you graph or retrieve the statistics for a metric, you specify the Period of time, such as five minutes, to use to calculate each statistical value. For example, if the Period is five minutes, the Sum is the sum of all sample Get statistics for a metric 294 Amazon CloudWatch User Guide values collected during the five-minute period, while the Minimum is the lowest value collected during the five-minute period. CloudWatch supports the following statistics for metrics. • SampleCount is the number of data points during the period. • Sum is the sum of the values of the all data points collected during the period. • Average is the value of Sum/SampleCount during the specified period. • Minimum is the lowest value observed during the specified period. • Maximum is the highest value observed during the specified period. • Percentile (p) indicates the relative standing of a value in a dataset. For example, p95 is the 95th percentile and means that 95 percent of the data within the period is lower than this value and 5 percent of the data is higher than this value. Percentiles help you get a better understanding of the distribution of your metric data. • Trimmed mean (TM) is the mean of all values that are between two specified boundaries. Values outside of the boundaries are ignored when the mean is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places. The numbers can be absolute values or percentages. For example, tm90 calculates the average after removing the 10% of data points with the highest values. TM(2%:98%) calculates the average after removing the 2% lowest data points and the 2% highest data points. TM(150:1000) calculates the average after removing all data points that are lower than or equal to 150, or higher than 1000. • Interquartile mean (IQM) is the trimmed mean of the interquartile range, or the middle 50% of values. It is equivalent to TM(25%:75%). • Winsorized mean (WM) is similar to trimmed mean. However, with winsorized mean, the values that are outside the boundary are not ignored, but |
acw-ug-105 | acw-ug.pdf | 105 | tm90 calculates the average after removing the 10% of data points with the highest values. TM(2%:98%) calculates the average after removing the 2% lowest data points and the 2% highest data points. TM(150:1000) calculates the average after removing all data points that are lower than or equal to 150, or higher than 1000. • Interquartile mean (IQM) is the trimmed mean of the interquartile range, or the middle 50% of values. It is equivalent to TM(25%:75%). • Winsorized mean (WM) is similar to trimmed mean. However, with winsorized mean, the values that are outside the boundary are not ignored, but instead are considered to be equal to the value at the edge of the appropriate boundary. After this normalization, the average is calculated. You define the boundaries as one or two numbers between 0 and 100, up to 10 decimal places. For example, wm98 calculates the average while treating the 2% of the highest values to be equal to the value at the 98th percentile. WM(10%:90%) calculates the average while treating the highest 10% of data points to be the value of the 90% boundary, and treating the lowest 10% of data points to be the value of the 10% boundary. • Percentile rank (PR) is the percentage of values that meet a fixed threshold. For example, PR(:300) returns the percentage of data points that have a value of 300 or less. PR(100:2000) returns the percentage of data points that have a value between 100 and 2000. Percentile rank is exclusive on the lower bound and inclusive on the upper bound. CloudWatch statistics definitions 295 Amazon CloudWatch User Guide • Trimmed count (TC) is the number of data points in the chosen range for a trimmed mean statistic. For example, tc90 returns the number of data points not including any data points that fall in the highest 10% of the values. TC(0.005:0.030) returns the number of data points with values between 0.005 (exclusive) and 0.030 (inclusive). Trimmed count can return a decimal value instead of an integer. This is because it is an interpolated, approximate value and can give fractional results. • Trimmed sum (TS) is the sum of the values of data points in a chosen range for a trimmed mean statistic. It is equivalent to (Trimmed Mean) * (Trimmed count). For example, ts90 returns the sum of the data points not including any data points that fall in the highest 10% of the values. TS(80%:) returns the sum of the data point values, not including any data points with values in the lowest 80% of the range of values. Note For Trimmed Mean, Trimmed Count, Trimmed Sum, and Winsorized Mean, if you define two boundaries as fixed values instead of percentages, the calculation includes values equal to the higher boundary, but does not include values equal to the lower boundary. Syntax For Trimmed Mean, Trimmed Count, Trimmed Sum, and Winsorized Mean, the following syntax rules apply: • Using parentheses with one or two numbers with percent signs defines the boundaries to use as the values in the data set that fall in between the two percentiles that you specify. For example, TM(10%:90%) uses only the values between the 10th and 90th percentiles. TM(:95%) uses the values from the lowest end of the data set up to the 95th percentile, ignoring the 5% of data points with the highest values. • Using parenthesis with one or two numbers without percent signs defines the boundaries to use as the values in the data set that fall in between the explicit values that you specify. For example, TC(80:500) uses only the values that are between 80 (exclusive) and 500 (inclusive). TC(:0.5) uses only the values that equal 0.5 or are lower. • Using one number without parentheses calculates using percentages, ignoring data points that are higher than the specified percentile. For example, tm99 calculates the mean while ignoring the 1% of the data points with the highest value. It is the same as TM(:99%). CloudWatch statistics definitions 296 Amazon CloudWatch User Guide • Trimmed mean, Trimmed Count, Trimmed Sum, and Winsorized Mean can all be abbreviated using uppercase letters when specifying a range, such as TM(5%:95%), TM(100:200), or TM(:95%). They can only be abbreviated using lowercase letters when you specifying only one number, such as tm99. Statistics use cases • Trimmed mean is most useful for metrics with a large sample size, such as webpage latency. For example, tm99 disregards extreme high outliers that could result from network problems or human errors, to give a more accurate number for the average latency of typical requests. Similarly, TM(10%:) disregards the lowest 10% of latency values, such as those resulting from cache hits. And TM(10%:99%) excludes both of these types of outliers. We recommend that you use trimmed mean for monitoring latency. • |
acw-ug-106 | acw-ug.pdf | 106 | only be abbreviated using lowercase letters when you specifying only one number, such as tm99. Statistics use cases • Trimmed mean is most useful for metrics with a large sample size, such as webpage latency. For example, tm99 disregards extreme high outliers that could result from network problems or human errors, to give a more accurate number for the average latency of typical requests. Similarly, TM(10%:) disregards the lowest 10% of latency values, such as those resulting from cache hits. And TM(10%:99%) excludes both of these types of outliers. We recommend that you use trimmed mean for monitoring latency. • It is a good idea to keep watch on trimmed count whenever you are using trimmed mean, to make sure that the number of values being used in your trimmed mean calculations are enough to be statistically significant. • Percentile rank enables you to put values into "bins" of ranges, and you can use this to manually create a histogram. To do this, break your values down into various bins, such as PR(:1), PR(1:5), PR(5:10), and PR(10:). Put each of these bins into a visualization as bar charts, and you have a histogram. Percentile rank is exclusive on the lower bound and inclusive on the upper bound. Percentiles versus trimmed mean A percentile such as p99 and a trimmed mean such as tm99 measure similar, but not identical values. Both p99 and tm99 ignore the 1% of the data points with the highest values, which are considered outliers. After that, p99 is the maximum value of the remaining 99%, while tm99 is the average of the remaining 99%. If you are looking at the latency of web requests, p99 tells you the worst customer experience, ignoring outliers, while tm99 tells you the average customer experience, ignoring outliers. Trimmed mean is a good latency statistic to watch if you are looking to optimize your customer experience. CloudWatch statistics definitions 297 Amazon CloudWatch User Guide Requirements to use percentiles, trimmed mean, and some other statistics CloudWatch needs raw data points to calculate the following statistics: • Percentiles • Trimmed mean • Interquartile mean • Winsorized mean • Trimmed sum • Trimmed count • Percentile rank If you publish data for a custom statistics using a statistic set instead of raw data, you can retrieve these types of statistics for this data only if one of the following conditions is true: • The SampleCount value of the statistic set is 1 and Min, Max, and Sum are all equal. • The Min and Max are equal, and Sum is equal to Min multiplied by SampleCount. The following AWS services include metrics that support these types of statistics. • API Gateway • Application Load Balancer • Amazon EC2 • Elastic Load Balancing • Kinesis • Amazon RDS Additionally, these type of statistics are not available for metrics when any of the metric values are negative numbers. The following examples show you how to get statistics for the CloudWatch metrics for your resources, such as your EC2 instances. Examples • Get statistics for a specific resource CloudWatch statistics definitions 298 Amazon CloudWatch User Guide • Aggregate statistics across resources • Aggregate statistics by Auto Scaling group • Aggregate statistics by Amazon Machine Image (AMI) Get statistics for a specific resource The following example shows you how to determine the maximum CPU utilization of a specific EC2 instance. Requirements • You must have the ID of the instance. You can get the instance ID using the Amazon EC2 console or the describe-instances command. • By default, basic monitoring is enabled, but you can enable detailed monitoring. For more information, see Enable or Disable Detailed Monitoring for Your Instances in the Amazon EC2 User Guide. To display the average CPU utilization for a specific instance using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, All metrics. Select the EC2 metric namespace. Get statistics for a specific resource 299 Amazon CloudWatch User Guide 4. Select the Per-Instance Metrics dimension. Get statistics for a specific resource 300 Amazon CloudWatch User Guide 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. Get statistics for a specific resource 301 Amazon CloudWatch User Guide 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). Get statistics for a specific resource 302 Amazon CloudWatch User Guide 7. To change the period, choose the Graphed |
acw-ug-107 | acw-ug.pdf | 107 | 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. Get statistics for a specific resource 301 Amazon CloudWatch User Guide 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). Get statistics for a specific resource 302 Amazon CloudWatch User Guide 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). Get statistics for a specific resource 303 Amazon CloudWatch User Guide { "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" } Aggregate statistics across resources You can aggregate the metrics for AWS resources across multiple resources. Metrics are completely separate between Regions, but you can use metric math to aggregate similar metrics across Regions. For more information, see Using math expressions with CloudWatch metrics. For example, you can aggregate statistics for your EC2 instances that have detailed monitoring enabled. Instances that use basic monitoring aren't included. Therefore, you must enable detailed monitoring (at an additional charge), which provides data in 1-minute periods. For more information, see Enable or Disable Detailed Monitoring for Your Instances in the Amazon EC2 User Guide. This example shows you how to get the average CPU usage for your EC2 instances. Because no dimension is specified, CloudWatch returns statistics for all dimensions in the AWS/EC2 namespace. To get statistics for other metrics, see AWS services that publish CloudWatch metrics. Aggregate statistics across resources 304 Amazon CloudWatch Important User Guide This technique for retrieving all dimensions across an AWS namespace doesn't work for custom namespaces that you publish to CloudWatch. With custom namespaces, you must specify the complete set of dimensions that are associated with any given data point to retrieve statistics that include the data point. To display average CPU utilization for your EC2 instances 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the EC2 namespace and choose Across All Instances. 4. Select the row that contains CPUUtilization, which displays a graph for the metric for all your EC2 instances. 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. Aggregate statistics across resources 305 Amazon CloudWatch User Guide 5. 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, p95.45). 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 average CPU utilization across your EC2 instances using the AWS CLI Use the get-metric-statistics command as follows: aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization --statistics "Average" "SampleCount" \ --start-time 2016-10-11T23:18:00 --end-time 2016-10-12T23:18:00 --period 3600 The following is example output: Aggregate statistics across resources 306 Amazon CloudWatch User Guide { "Datapoints": [ { "SampleCount": 238.0, "Timestamp": "2016-10-12T07:18:00Z", "Average": 0.038235294117647062, "Unit": "Percent" }, { "SampleCount": 240.0, "Timestamp": "2016-10-12T09:18:00Z", "Average": 0.16670833333333332, "Unit": "Percent" }, { "SampleCount": 238.0, "Timestamp": "2016-10-11T23:18:00Z", "Average": 0.041596638655462197, "Unit": "Percent" }, ... ], "Label": "CPUUtilization" } Aggregate statistics by Auto Scaling group You can aggregate statistics for the EC2 instances in an Auto Scaling group. Metrics are completely separate between Regions, but you can use CloudWatch metric math to aggregate and transform metrics from multiple Regions. You can also use the cross-account dashboard to perform metric math on metrics from different accounts. This example shows you how to get the total bytes written to disk for one Auto Scaling group. The total is computed for 1-minute periods for a 24-hour interval across all EC2 instances in the specified Auto Scaling group. To display DiskWriteBytes |
acw-ug-108 | acw-ug.pdf | 108 | "CPUUtilization" } Aggregate statistics by Auto Scaling group You can aggregate statistics for the EC2 instances in an Auto Scaling group. Metrics are completely separate between Regions, but you can use CloudWatch metric math to aggregate and transform metrics from multiple Regions. You can also use the cross-account dashboard to perform metric math on metrics from different accounts. This example shows you how to get the total bytes written to disk for one Auto Scaling group. The total is computed for 1-minute periods for a 24-hour interval across all EC2 instances in the specified Auto Scaling group. To display DiskWriteBytes for the instances in an Auto Scaling group using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the EC2 namespace and then choose By Auto Scaling Group. Aggregate statistics by Auto Scaling group 307 Amazon CloudWatch User Guide 4. Select the row for the DiskWriteBytes metric and the specific Auto Scaling group, which displays a graph for the metric for the instances in the Auto Scaling group. 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. 5. 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, p95.45). 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 DiskWriteBytes for the instances in an Auto Scaling group using the AWS CLI Use the get-metric-statistics command as follows. aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name DiskWriteBytes --dimensions Name=AutoScalingGroupName,Value=my-asg --statistics "Sum" "SampleCount" \ --start-time 2016-10-16T23:18:00 --end-time 2016-10-18T23:18:00 --period 360 The following is example output. Aggregate statistics by Auto Scaling group 308 Amazon CloudWatch User Guide { "Datapoints": [ { "SampleCount": 18.0, "Timestamp": "2016-10-19T21:36:00Z", "Sum": 0.0, "Unit": "Bytes" }, { "SampleCount": 5.0, "Timestamp": "2016-10-19T21:42:00Z", "Sum": 0.0, "Unit": "Bytes" } ], "Label": "DiskWriteBytes" } Aggregate statistics by Amazon Machine Image (AMI) You can aggregate statistics for the EC2 instances that have detailed monitoring enabled. Instances that use basic monitoring aren't included. For more information, see Enable or Disable Detailed Monitoring for Your Instances in the Amazon EC2 User Guide. This example shows you how to determine average CPU utilization for all instances that use the specified AMI. The average is over 60-second time intervals for a one-day period. To display the average CPU utilization by AMI using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the EC2 namespace and then choose By Image (AMI) Id. 4. Select the row for the CPUUtilization metric and the specific AMI, which displays a graph for the metric for the specified AMI. 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. Aggregating statistics by AMI 309 Amazon CloudWatch User Guide 5. 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, p95.45). 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 average CPU utilization by AMI using the AWS CLI Use the get-metric-statistics command as follows. aws cloudwatch get-metric-statistics --namespace AWS/EC2 --metric-name CPUUtilization \ --dimensions Name=ImageId,Value=ami-3c47a355 --statistics Average \ --start-time 2016-10-10T00:00:00 --end-time 2016-10-11T00:00:00 --period 3600 The operation returns statistics that are one-hour values for the one-day interval. Each value represents an average CPU utilization percentage for EC2 instances running the specified AMI. The following is example output. { "Datapoints": [ Aggregating statistics by AMI 310 User Guide Amazon CloudWatch { "Timestamp": "2016-10-10T07:00:00Z", "Average": 0.041000000000000009, "Unit": "Percent" }, { "Timestamp": "2016-10-10T14:00:00Z", "Average": 0.079579831932773085, "Unit": "Percent" }, { "Timestamp": "2016-10-10T06:00:00Z", "Average": 0.036000000000000011, "Unit": "Percent" }, ... ], "Label": "CPUUtilization" } Publish custom metrics You can publish your own metrics to CloudWatch using the AWS CLI or an API. You can view statistical graphs of your published metrics with the AWS Management Console. CloudWatch stores data about a metric as a series of data points. Each data point has an associated time stamp. You can even publish an aggregated set of data points called a statistic set. Topics • High-resolution metrics • Use dimensions • Publish single data points • Publish statistic sets • Publish the value zero • Stop publishing metrics High-resolution metrics Each metric is one of the following: Publish custom metrics 311 Amazon CloudWatch User Guide • Standard resolution, with data |
acw-ug-109 | acw-ug.pdf | 109 | AWS CLI or an API. You can view statistical graphs of your published metrics with the AWS Management Console. CloudWatch stores data about a metric as a series of data points. Each data point has an associated time stamp. You can even publish an aggregated set of data points called a statistic set. Topics • High-resolution metrics • Use dimensions • Publish single data points • Publish statistic sets • Publish the value zero • Stop publishing metrics High-resolution metrics Each metric is one of the following: Publish custom metrics 311 Amazon CloudWatch User Guide • Standard resolution, with data having a one-minute granularity • High resolution, with data at a granularity of one second Metrics produced by AWS services are standard resolution by default. When you publish a custom metric, you can define it as either standard resolution or high resolution. When you publish a high- resolution metric, CloudWatch stores it with a resolution of 1 second, and you can read and retrieve it with a period of 1 second, 5 seconds, 10 seconds, 30 seconds, or any multiple of 60 seconds. High-resolution metrics can give you more immediate insight into your application's sub-minute activity. Keep in mind that every PutMetricData call for a custom metric is charged, so calling PutMetricData more often on a high-resolution metric can lead to higher charges. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. If you set an alarm on a high-resolution metric, you can specify a high-resolution alarm with a period of 10 seconds or 30 seconds, or you can set a regular alarm with a period of any multiple of 60 seconds. There is a higher charge for high-resolution alarms with a period of 10 or 30 seconds. Use dimensions In custom metrics, the --dimensions parameter is common. A dimension further clarifies what the metric is and what data it stores. You can have up to 30 dimensions assigned to one metric, and each dimension is defined by a name and value pair. How you specify a dimension is different when you use different commands. With put-metric-data, you specify each dimension as MyName=MyValue, and with get-metric-statistics or put-metric- alarm you use the format Name=MyName, Value=MyValue. For example, the following command publishes a Buffers metric with two dimensions named InstanceId and InstanceType. aws cloudwatch put-metric-data --metric-name Buffers --namespace MyNameSpace --unit Bytes --value 231434333 --dimensions InstanceId=1-23456789,InstanceType=m1.small This command retrieves statistics for that same metric. Separate the Name and Value parts of a single dimension with commas, but if you have multiple dimensions, use a space between one dimension and the next. aws cloudwatch get-metric-statistics --metric-name Buffers --namespace MyNameSpace -- dimensions Name=InstanceId,Value=1-23456789 Name=InstanceType,Value=m1.small --start- time 2016-10-15T04:00:00Z --end-time 2016-10-19T07:00:00Z --statistics Average --period 60 Use dimensions 312 Amazon CloudWatch User Guide If a single metric includes multiple dimensions, you must specify a value for every defined dimension when you use get-metric-statistics. For example, the Amazon S3 metric BucketSizeBytes includes the dimensions BucketName and StorageType, so you must specify both dimensions with get-metric-statistics. aws cloudwatch get-metric-statistics --metric-name BucketSizeBytes --start-time 2017-01-23T14:23:00Z --end-time 2017-01-26T19:30:00Z --period 3600 --namespace AWS/S3 --statistics Maximum --dimensions Name=BucketName,Value=amzn-s3-demo-bucket Name=StorageType,Value=StandardStorage --output table To see what dimensions are defined for a metric, use the list-metrics command. Publish single data points To publish a single data point for a new or existing metric, use the put-metric-data command with one value and time stamp. For example, the following actions each publish one data point. aws cloudwatch put-metric-data --metric-name PageViewCount --namespace MyService -- value 2 --timestamp 2016-10-20T12:00:00.000Z aws cloudwatch put-metric-data --metric-name PageViewCount --namespace MyService -- value 4 --timestamp 2016-10-20T12:00:01.000Z aws cloudwatch put-metric-data --metric-name PageViewCount --namespace MyService -- value 5 --timestamp 2016-10-20T12:00:02.000Z If you call this command with a new metric name, CloudWatch creates a metric for you. Otherwise, CloudWatch associates your data with the existing metric that you specified. Note When you create a metric, it can take up to 2 minutes before you can retrieve statistics for the new metric using the get-metric-statistics command. However, it can take up to 15 minutes before the new metric appears in the list of metrics retrieved using the list-metrics command. Although you can publish data points with time stamps as granular as one-thousandth of a second, CloudWatch aggregates the data to a minimum granularity of 1 second. CloudWatch records the average (sum of all items divided by number of items) of the values received for each period, as well as the number of samples, maximum value, and minimum value for the same time period. For Publish single data points 313 Amazon CloudWatch User Guide example, the PageViewCount metric from the previous examples contains three data points with time stamps just seconds apart. If you have your period set to 1 minute, CloudWatch aggregates the three data points because they all have time stamps within a 1-minute period. You can use |
acw-ug-110 | acw-ug.pdf | 110 | to a minimum granularity of 1 second. CloudWatch records the average (sum of all items divided by number of items) of the values received for each period, as well as the number of samples, maximum value, and minimum value for the same time period. For Publish single data points 313 Amazon CloudWatch User Guide example, the PageViewCount metric from the previous examples contains three data points with time stamps just seconds apart. If you have your period set to 1 minute, CloudWatch aggregates the three data points because they all have time stamps within a 1-minute period. You can use the get-metric-statistics command to retrieve statistics based on the data points that you published. aws cloudwatch get-metric-statistics --namespace MyService --metric-name PageViewCount \ --statistics "Sum" "Maximum" "Minimum" "Average" "SampleCount" \ --start-time 2016-10-20T12:00:00.000Z --end-time 2016-10-20T12:05:00.000Z --period 60 The following is example output. { "Datapoints": [ { "SampleCount": 3.0, "Timestamp": "2016-10-20T12:00:00Z", "Average": 3.6666666666666665, "Maximum": 5.0, "Minimum": 2.0, "Sum": 11.0, "Unit": "None" } ], "Label": "PageViewCount" } Publish statistic sets You can aggregate your data before you publish to CloudWatch. When you have multiple data points per minute, aggregating data minimizes the number of calls to put-metric-data. For example, instead of calling put-metric-data multiple times for three data points that are within 3 seconds of each other, you can aggregate the data into a statistic set that you publish with one call, using the --statistic-values parameter. aws cloudwatch put-metric-data --metric-name PageViewCount --namespace MyService --statistic-values Sum=11,Minimum=2,Maximum=5,SampleCount=3 -- timestamp 2016-10-14T12:00:00.000Z Publish statistic sets 314 Amazon CloudWatch User Guide CloudWatch needs raw data points to calculate percentiles. If you publish data using a statistic set instead, you can't retrieve percentile statistics for this data unless one of the following conditions is true: • The SampleCount of the statistic set is 1 • The Minimum and the Maximum of the statistic set are equal Publish the value zero When your data is more sporadic and you have periods that have no associated data, you can choose to publish the value zero (0) for that period or no value at all. If you use periodic calls to PutMetricData to monitor the health of your application, you might want to publish zero instead of no value. For example, you can set a CloudWatch alarm to notify you if your application fails to publish metrics every five minutes. You want such an application to publish zeros for periods with no associated data. You might also publish zeros if you want to track the total number of data points or if you want statistics such as minimum and average to include data points with the value 0. Stop publishing metrics To stop publishing custom metrics to CloudWatch, change your application's or service's code to stop using PutMetricData. CloudWatch doesn't pull metrics from applications, it only receives what is pushed to it, so to stop publishing your metrics you must stop them at the source. Publish the value zero 315 Amazon CloudWatch User Guide Using Amazon CloudWatch alarms You can create alarms that watch metrics and send notifications or automatically make changes to the resources you are monitoring when a threshold is breached. For example, you can monitor the CPU usage and disk reads and writes of your Amazon EC2 instances and then use that data to determine whether you should launch additional instances to handle increased load. You can also use this data to stop under-used instances to save money. You can create both metric and composite alarms in Amazon CloudWatch. • A metric alarm watches a single CloudWatch metric or the result of a math expression based on CloudWatch metrics. The alarm performs one or more actions based on the value of the metric or expression relative to a threshold over a number of time periods. The action can be sending a notification to an Amazon SNS topic, performing an Amazon EC2 action or an Amazon EC2 Auto Scaling action, starting an investigation in Amazon Q Developer operational investigations, or creating an OpsItem or incident in Systems Manager. • A composite alarm includes a rule expression that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met. The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms. Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, a composite might go into ALARM state only when all of the underlying metric alarms are in ALARM state. Composite alarms can send Amazon SNS notifications when they change state, and can create investigations, Systems Manager OpsItems, or incidents when they go into ALARM state, but can't perform |
acw-ug-111 | acw-ug.pdf | 111 | of the rule are met. The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms. Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, a composite might go into ALARM state only when all of the underlying metric alarms are in ALARM state. Composite alarms can send Amazon SNS notifications when they change state, and can create investigations, Systems Manager OpsItems, or incidents when they go into ALARM state, but can't perform EC2 actions or Auto Scaling actions. Note You can create as many alarms as you want in your AWS account. You can add alarms to dashboards, so you can monitor and receive alerts about your AWS resources and applications across multiple regions. After you add an alarm to a dashboard, the alarm turns 316 Amazon CloudWatch User Guide gray when it's in the INSUFFICIENT_DATA state and red when it's in the ALARM state. The alarm is shown with no color when it's in the OK state. You also can favorite recently visited alarms from the Favorites and recents option in the CloudWatch console navigation pane. The Favorites and recents option has columns for your favorited alarms and recently visited alarms. An alarm invokes actions only when the alarm changes state. The exception is for alarms with Auto Scaling actions. For Auto Scaling actions, the alarm continues to invoke the action once per minute that the alarm remains in the new state. An alarm can watch a metric in the same account. If you have enabled cross-account functionality in your CloudWatch console, you can also create alarms that watch metrics in other AWS accounts. Creating cross-account composite alarms is not supported. Creating cross-account alarms that use math expressions is supported, except that the ANOMALY_DETECTION_BAND, INSIGHT_RULE, and SERVICE_QUOTA functions are not supported for cross-account alarms. Note CloudWatch doesn't test or validate the actions that you specify, nor does it detect any Amazon EC2 Auto Scaling or Amazon SNS errors resulting from an attempt to invoke nonexistent actions. Make sure that your alarm actions exist. Metric alarm states A metric alarm has the following possible states: • OK – The metric or expression is within the defined threshold. • ALARM – The metric or expression is outside of the defined threshold. • INSUFFICIENT_DATA – The alarm has just started, the metric is not available, or not enough data is available for the metric to determine the alarm state. Evaluating an alarm When you create an alarm, you specify three settings to enable CloudWatch to evaluate when to change the alarm state: Metric alarm states 317 Amazon CloudWatch User Guide • Period is the length of time to use to evaluate the metric or expression to create each individual data point for an alarm. It is expressed in seconds. • Evaluation Periods is the number of the most recent periods, or data points, to evaluate when determining alarm state. • Datapoints to Alarm is the number of data points within the Evaluation Periods that must be breaching to cause the alarm to go to the ALARM state. The breaching data points don't have to be consecutive, but they must all be within the last number of data points equal to Evaluation Period. For any period of one minute or longer, an alarm is evaluated every minute and the evaluation is based on the window of time defined by the Period and Evaluation Periods. For example, if the Period is 5 minutes (300 seconds) and Evaluation Periods is 1, then at the end of minute 5 the alarm evaluates based on data from minutes 1 to 5. Then at the end of minute 6, the alarm is evaluated based on the data from minutes 2 to 6. If the alarm period is 10 seconds, 20 seconds, or 30 seconds, the alarm is evaluated every 10 seconds. If the number of evaluation periods multiplied by the length of each evaluation period exceeds one day, the alarm is evaluated once per hour. For more details about how these multi-day alarms are evaluated, see the example at the end of this section. In the following figure, the alarm threshold for a metric alarm is set to three units. Both Evaluation Period and Datapoints to Alarm are 3. That is, when all existing data points in the most recent three consecutive periods are above the threshold, the alarm goes to ALARM state. In the figure, this happens in the third through fifth time periods. At period six, the value dips below the threshold, so one of the periods being evaluated is not breaching, and the alarm state changes back to OK. During the ninth time period, the threshold is |
acw-ug-112 | acw-ug.pdf | 112 | end of this section. In the following figure, the alarm threshold for a metric alarm is set to three units. Both Evaluation Period and Datapoints to Alarm are 3. That is, when all existing data points in the most recent three consecutive periods are above the threshold, the alarm goes to ALARM state. In the figure, this happens in the third through fifth time periods. At period six, the value dips below the threshold, so one of the periods being evaluated is not breaching, and the alarm state changes back to OK. During the ninth time period, the threshold is breached again, but for only one period. Consequently, the alarm state remains OK. Evaluating an alarm 318 Amazon CloudWatch User Guide When you configure Evaluation Periods and Datapoints to Alarm as different values, you're setting an "M out of N" alarm. Datapoints to Alarm is ("M") and Evaluation Periods is ("N"). The evaluation interval is the number of evaluation periods multiplied by the period length. For example, if you configure 4 out of 5 data points with a period of 1 minute, the evaluation interval is 5 minutes. If you configure 3 out of 3 data points with a period of 10 minutes, the evaluation interval is 30 minutes. Note If data points are missing soon after you create an alarm, and the metric was being reported to CloudWatch before you created the alarm, CloudWatch retrieves the most recent data points from before the alarm was created when evaluating the alarm. Evaluating an alarm 319 Amazon CloudWatch User Guide Example of evaluating a multi-day alarm An alarm is a multi-day alarm if the number of evaluation periods multiplied by the length of each evaluation period exceeds one day. Multi-day alarms are evaluated once per hour. When multi-day alarms are evaluated, CloudWatch takes into account only the metrics up to the current hour at the :00 minute when evaluating. For example, consider an alarm that monitors a job that runs every 3 days at 10:00. 1. At 10:02, the job fails 2. At 10:03, the alarm evaluates and stays in OK state, because the evaluation considers data only up to 10:00. 3. At 11:03, the alarm considers data up to 11:00 and goes into ALARM state. 4. At 11:43, you correct the error and the job now runs successfully. 5. At 12:03, the alarm evaluates again, sees the successful job, and returns to OK state. Alarm actions You can specify what actions an alarm takes when it changes state between the OK, ALARM, and INSUFFICIENT_DATA states. Most actions can be set for the transition into each of the three states. Except for Auto Scaling actions, the actions happen only on state transitions, and are not performed again if the condition persists for hours or days. You can use the fact that multiple actions are allowed for an alarm to send an email when a threshold is breached, and then another when the breaching condition ends. This helps you verify that your scaling or recovery actions are triggered when expected and are working as desired. The following are supported as alarm actions. • Notify one or more subscribers by using an Amazon Simple Notification Service topic. Subscribers can be applications as well as persons. For more information about Amazon SNS, see What is Amazon SNS?. • Invoke a Lambda function. This is the easiest way for you to automate custom actions on alarm state changes. Example of evaluating a multi-day alarm 320 Amazon CloudWatch User Guide • Alarms based on EC2 metrics can also perform EC2 actions, such as stopping, terminating, rebooting, or recovering an EC2 instance. For more information, see Create alarms to stop, terminate, reboot, or recover an EC2 instance. • Alarms can perform actions to scale an Auto Scaling group. For more information, see Step and simple scaling policies for Amazon EC2 Auto Scaling. • Alarms can create OpsItems in Systems Manager Ops Center or create incidents in AWS Systems Manager Incident Manager. These actions are performed only when the alarm goes into ALARM state. For more information, see Configuring CloudWatch to create OpsItems from alarms and Incident creation. • An alarm can start an investigation when it goes into ALARM state. For more information about Amazon Q Developer operational investigations, see Amazon Q Developer operational investigations (Preview). Alarms also emit events to Amazon EventBridge when they change state, and you can set up Amazon EventBridge to trigger other actions for these state changes. For more information, see What is Amazon EventBridge?. Lambda alarm actions CloudWatch alarms guarantees an asynchronous invocation of the Lambda function for a given state change, except in the following cases: • When the function doesn't exist. • When CloudWatch is not authorized to invoke the Lambda function. If CloudWatch can't reach the Lambda service |
acw-ug-113 | acw-ug.pdf | 113 | into ALARM state. For more information about Amazon Q Developer operational investigations, see Amazon Q Developer operational investigations (Preview). Alarms also emit events to Amazon EventBridge when they change state, and you can set up Amazon EventBridge to trigger other actions for these state changes. For more information, see What is Amazon EventBridge?. Lambda alarm actions CloudWatch alarms guarantees an asynchronous invocation of the Lambda function for a given state change, except in the following cases: • When the function doesn't exist. • When CloudWatch is not authorized to invoke the Lambda function. If CloudWatch can't reach the Lambda service or the message is rejected for another reason, CloudWatch retries until the invocation is successful. Lambda queues the message and handles execution retries. For more information about this execution model, including information about how Lambda handles errors, see Asynchronous invocation in the AWS Lambda Developer Guide. You can invoke a Lambda function in the same account, or in other AWS accounts. When you specify an alarm to invoke a Lambda function as an alarm action, you can choose to specify the function name, function alias, or a specific version of a function. When you specify a Lambda function as an alarm action, you must create a resource policy for the function to allow the CloudWatch service principal to invoke the function. Lambda alarm actions 321 Amazon CloudWatch User Guide One way to do this is by using the AWS CLI, as in the following example: aws lambda add-permission \ --function-name my-function-name \ --statement-id AlarmAction \ --action 'lambda:InvokeFunction' \ --principal lambda.alarms.cloudwatch.amazonaws.com \ --source-account 111122223333 \ --source-arn arn:aws:cloudwatch:us-east-1:111122223333:alarm:alarm-name Alternatively, you can create a policy similar to one of the following examples and then assign it to the function. The following example specifies the account where the alarm is located, so that only alarms in that account (111122223333) can invoke the function. { "Version": "2012-10-17", "Id": "default", "Statement": [{ "Sid": "AlarmAction", "Effect": "Allow", "Principal": { "Service": "lambda.alarms.cloudwatch.amazonaws.com" }, "Action": "lambda:InvokeFunction", "Resource": "arn:aws:lambda:us-east-1:444455556666:function:function-name", "Condition": { "StringEquals": { "AWS:SourceAccount": "111122223333" } } }] } The following example has a narrower scope, allowing only the specified alarm in the specified account to invoke the function. { "Version": "2012-10-17", "Id": "default", "Statement": [ Lambda alarm actions 322 Amazon CloudWatch { "Sid": "AlarmAction", "Effect": "Allow", "Principal": { User Guide "Service": "lambda.alarms.cloudwatch.amazonaws.com" }, "Action": "lambda:InvokeFunction", "Resource": "arn:aws:lambda:us-east-1:444455556666:function:function-name", "Condition": { "StringEquals": { "AWS:SourceAccount": "111122223333", "AWS:SourceArn": "arn:aws:cloudwatch:us-east-1:111122223333:alarm:alarm-name" } } }] } We don't recommend creating a policy that doesn't specify a source account, because such policies are vulnerable to confused deputy issues. Event object sent from CloudWatch to Lambda When you configure a Lambda function as an alarm action, CloudWatch delivers a JSON payload to the Lambda function when it invokes the function. This JSON payload serves as the event object for the function. You can extract data from this JSON object and use it in your function. The following is an example of an event object from a metric alarm. { 'source': 'aws.cloudwatch', 'alarmArn': 'arn:aws:cloudwatch:us-east-1:444455556666:alarm:lambda-demo-metric- alarm', 'accountId': '444455556666', 'time': '2023-08-04T12:36:15.490+0000', 'region': 'us-east-1', 'alarmData': { 'alarmName': 'lambda-demo-metric-alarm', 'state': { 'value': 'ALARM', 'reason': 'test', 'timestamp': '2023-08-04T12:36:15.490+0000' }, 'previousState': { 'value': 'INSUFFICIENT_DATA', Lambda alarm actions 323 Amazon CloudWatch User Guide 'reason': 'Insufficient Data: 5 datapoints were unknown.', 'reasonData': '{"version":"1.0","queryDate":"2023-08-04T12:31:29.591+0000","statistic":"Average","period":60,"recentDatapoints": [],"threshold":5.0,"evaluatedDatapoints":[{"timestamp":"2023-08-04T12:30:00.000+0000"}, {"timestamp":"2023-08-04T12:29:00.000+0000"}, {"timestamp":"2023-08-04T12:28:00.000+0000"}, {"timestamp":"2023-08-04T12:27:00.000+0000"}, {"timestamp":"2023-08-04T12:26:00.000+0000"}]}', 'timestamp': '2023-08-04T12:31:29.595+0000' }, 'configuration': { 'description': 'Metric Alarm to test Lambda actions', 'metrics': [ { 'id': '1234e046-06f0-a3da-9534-EXAMPLEe4c', 'metricStat': { 'metric': { 'namespace': 'AWS/Logs', 'name': 'CallCount', 'dimensions': { 'InstanceId': 'i-12345678' } }, 'period': 60, 'stat': 'Average', 'unit': 'Percent' }, 'returnData': True } ] } } } The following is an example of an event object from a composite alarm. { 'source': 'aws.cloudwatch', 'alarmArn': 'arn:aws:cloudwatch:us-east-1:111122223333:alarm:SuppressionDemo.Main', 'accountId': '111122223333', 'time': '2023-08-04T12:56:46.138+0000', 'region': 'us-east-1', 'alarmData': { Lambda alarm actions 324 Amazon CloudWatch User Guide 'alarmName': 'CompositeDemo.Main', 'state': { 'value': 'ALARM', 'reason': 'arn:aws:cloudwatch:us- east-1:111122223333:alarm:CompositeDemo.FirstChild transitioned to ALARM at Friday 04 August, 2023 12:54:46 UTC', 'reasonData': '{"triggeringAlarms":[{"arn":"arn:aws:cloudwatch:us- east-1:111122223333:alarm:CompositeDemo.FirstChild","state": {"value":"ALARM","timestamp":"2023-08-04T12:54:46.138+0000"}}]}', 'timestamp': '2023-08-04T12:56:46.138+0000' }, 'previousState': { 'value': 'ALARM', 'reason': 'arn:aws:cloudwatch:us- east-1:111122223333:alarm:CompositeDemo.FirstChild transitioned to ALARM at Friday 04 August, 2023 12:54:46 UTC', 'reasonData': '{"triggeringAlarms":[{"arn":"arn:aws:cloudwatch:us- east-1:111122223333:alarm:CompositeDemo.FirstChild","state": {"value":"ALARM","timestamp":"2023-08-04T12:54:46.138+0000"}}]}', 'timestamp': '2023-08-04T12:54:46.138+0000', 'actionsSuppressedBy': 'WaitPeriod', 'actionsSuppressedReason': 'Actions suppressed by WaitPeriod' }, 'configuration': { 'alarmRule': 'ALARM(CompositeDemo.FirstChild) OR ALARM(CompositeDemo.SecondChild)', 'actionsSuppressor': 'CompositeDemo.ActionsSuppressor', 'actionsSuppressorWaitPeriod': 120, 'actionsSuppressorExtensionPeriod': 180 } } } Configuring how CloudWatch alarms treat missing data Sometimes, not every expected data point for a metric gets reported to CloudWatch. For example, this can happen when a connection is lost, a server goes down, or when a metric reports data only intermittently by design. CloudWatch enables you to specify how to treat missing data points when evaluating an alarm. This helps you to configure your alarm so that it goes to ALARM state only when appropriate for the Configuring how alarms treat missing data 325 Amazon CloudWatch User Guide type of data being monitored. You can avoid false positives when missing data doesn't indicate a problem. Similar to |
acw-ug-114 | acw-ug.pdf | 114 | not every expected data point for a metric gets reported to CloudWatch. For example, this can happen when a connection is lost, a server goes down, or when a metric reports data only intermittently by design. CloudWatch enables you to specify how to treat missing data points when evaluating an alarm. This helps you to configure your alarm so that it goes to ALARM state only when appropriate for the Configuring how alarms treat missing data 325 Amazon CloudWatch User Guide type of data being monitored. You can avoid false positives when missing data doesn't indicate a problem. Similar to how each alarm is always in one of three states, each specific data point reported to CloudWatch falls under one of three categories: • Not breaching (within the threshold) • Breaching (violating the threshold) • Missing For each alarm, you can specify CloudWatch to treat missing data points as any of the following: • notBreaching – Missing data points are treated as "good" and within the threshold • breaching – Missing data points are treated as "bad" and breaching the threshold • ignore – The current alarm state is maintained • missing – If all data points in the alarm evaluation range are missing, the alarm transitions to INSUFFICIENT_DATA. The best choice depends on the type of metric and the purpose of the alarm. For example, if you are creating an application rollback alarm using a metric that continually reports data, you might want to treat missing data points as breaching, because it might indicate that something is wrong. But for a metric that generates data points only when an error occurs, such as ThrottledRequests in Amazon DynamoDB, you would want to treat missing data as notBreaching. The default behavior is missing. Important Alarms configured on Amazon EC2 metrics can temporarily enter the INSUFFICIENT_DATA state if there are missing metric data points. This is rare, but can happen when the metric reporting is interrupted, even when the Amazon EC2 instance is healthy. For alarms on Amazon EC2 metrics that are configured to take stop, terminate, reboot, or recover actions, we recommend that you configure those alarms to treat missing data as missing, and to have these alarms trigger only when in the ALARM state. Configuring how alarms treat missing data 326 Amazon CloudWatch User Guide Choosing the best option for your alarm prevents unnecessary and misleading alarm condition changes, and also more accurately indicates the health of your system. Important Alarms that evaluate metrics in the AWS/DynamoDB namespace always ignore missing data even if you choose a different option for how the alarm should treat missing data. When an AWS/DynamoDB metric has missing data, alarms that evaluate that metric remain in their current state. How alarm state is evaluated when data is missing Whenever an alarm evaluates whether to change state, CloudWatch attempts to retrieve a higher number of data points than the number specified as Evaluation Periods. The exact number of data points it attempts to retrieve depends on the length of the alarm period and whether it is based on a metric with standard resolution or high resolution. The time frame of the data points that it attempts to retrieve is the evaluation range. Once CloudWatch retrieves these data points, the following happens: • If no data points in the evaluation range are missing, CloudWatch evaluates the alarm based on the most recent data points collected. The number of data points evaluated is equal to the Evaluation Periods for the alarm. The extra data points from farther back in the evaluation range are not needed and are ignored. • If some data points in the evaluation range are missing, but the total number of existing data points that were successfully retrieved from the evaluation range is equal to or more than the alarm's Evaluation Periods, CloudWatch evaluates the alarm state based on the most recent real data points that were successfully retrieved, including the necessary extra data points from farther back in the evaluation range. In this case, the value you set for how to treat missing data is not needed and is ignored. • If some data points in the evaluation range are missing, and the number of actual data points that were retrieved is lower than the alarm's number of Evaluation Periods, CloudWatch fills in the missing data points with the result you specified for how to treat missing data, and then evaluates the alarm. However, all real data points in the evaluation range are included in the evaluation. CloudWatch uses missing data points only as few times as possible. How alarm state is evaluated when data is missing 327 Amazon CloudWatch Note User Guide A particular case of this behavior is that CloudWatch alarms might repeatedly re-evaluate the last set of data points for a |
acw-ug-115 | acw-ug.pdf | 115 | of actual data points that were retrieved is lower than the alarm's number of Evaluation Periods, CloudWatch fills in the missing data points with the result you specified for how to treat missing data, and then evaluates the alarm. However, all real data points in the evaluation range are included in the evaluation. CloudWatch uses missing data points only as few times as possible. How alarm state is evaluated when data is missing 327 Amazon CloudWatch Note User Guide A particular case of this behavior is that CloudWatch alarms might repeatedly re-evaluate the last set of data points for a period of time after the metric has stopped flowing. This re- evaluation might cause the alarm to change state and re-execute actions, if it had changed state immediately prior to the metric stream stopping. To mitigate this behavior, use shorter periods. The following tables illustrate examples of the alarm evaluation behavior. In the first table, Datapoints to Alarm and Evaluation Periods are both 3. CloudWatch retrieves the 5 most recent data points when evaluating the alarm, in case some of the most recent 3 data points are missing. 5 is the evaluation range for the alarm. Column 1 shows the 5 most recent data points, because the evaluation range is 5. These data points are shown with the most recent data point on the right. 0 is a non-breaching data point, X is a breaching data point, and - is a missing data point. Column 2 shows how many of the 3 necessary data points are missing. Even though the most recent 5 data points are evaluated, only 3 (the setting for Evaluation Periods) are necessary to evaluate the alarm state. The number of data points in Column 2 is the number of data points that must be "filled in", using the setting for how missing data is being treated. In columns 3-6, the column headers are the possible values for how to treat missing data. The rows in these columns show the alarm state that is set for each of these possible ways to treat missing data. Data points # of data points that must be filled 0 - X - X 0 - - - - - - - - - 0 2 3 MISSING IGNORE BREACHING NOT BREACHING OK OK OK OK OK OK INSUFFICI ENT_DATA Retain current state ALARM OK OK OK How alarm state is evaluated when data is missing 328 Amazon CloudWatch Data points # of data points that must be filled MISSING IGNORE BREACHING User Guide NOT BREACHING 0 X X - X - - X - - 0 2 ALARM ALARM ALARM ALARM ALARM Retain current state ALARM OK In the second row of the preceding table, the alarm stays OK even if missing data is treated as breaching, because the one existing data point is not breaching, and this is evaluated along with two missing data points which are treated as breaching. The next time this alarm is evaluated, if the data is still missing it will go to ALARM, as that non-breaching data point will no longer be in the evaluation range. The third row, where all five of the most recent data points are missing, illustrates how the various settings for how to treat missing data affect the alarm state. If missing data points are considered breaching, the alarm goes into ALARM state, while if they are considered not breaching, then the alarm goes into OK state. If missing data points are ignored, the alarm retains the current state it had before the missing data points. And if missing data points are just considered as missing, then the alarm does not have enough recent real data to make an evaluation, and goes into INSUFFICIENT_DATA. In the fourth row, the alarm goes to ALARM state in all cases because the three most recent data points are breaching, and the alarm's Evaluation Periods and Datapoints to Alarm are both set to 3. In this case, the missing data point is ignored and the setting for how to evaluate missing data is not needed, because there are 3 real data points to evaluate. Row 5 represents a special case of alarm evaluation called premature alarm state. For more information, see Avoiding premature transitions to alarm state. In the next table, the Period is again set to 5 minutes, and Datapoints to Alarm is only 2 while Evaluation Periods is 3. This is a 2 out of 3, M out of N alarm. The evaluation range is 5. This is the maximum number of recent data points that are retrieved and can be used in case some data points are missing. How alarm state is evaluated when data is missing 329 Amazon CloudWatch Data points # of missing data points MISSING IGNORE BREACHING |
acw-ug-116 | acw-ug.pdf | 116 | called premature alarm state. For more information, see Avoiding premature transitions to alarm state. In the next table, the Period is again set to 5 minutes, and Datapoints to Alarm is only 2 while Evaluation Periods is 3. This is a 2 out of 3, M out of N alarm. The evaluation range is 5. This is the maximum number of recent data points that are retrieved and can be used in case some data points are missing. How alarm state is evaluated when data is missing 329 Amazon CloudWatch Data points # of missing data points MISSING IGNORE BREACHING User Guide NOT BREACHING 0 - X - X 0 0 X 0 X 0 - X - - - - - - 0 - - - X - 0 0 1 2 2 ALARM ALARM ALARM ALARM ALARM ALARM ALARM ALARM OK OK ALARM OK OK Retain current state ALARM ALARM ALARM OK OK OK In rows 1 and 2, the alarm always goes to ALARM state because 2 of the 3 most recent data points are breaching. In row 2, the two oldest data points in the evaluation range are not needed because none of the 3 most recent data points are missing, so these two older data points are ignored. In rows 3 and 4, the alarm goes to ALARM state only if missing data is treated as breaching, in which case the two most recent missing data points are both treated as breaching. In row 4, these two missing data points that are treated as breaching provide the two necessary breaching data points to trigger the ALARM state. Row 5 represents a special case of alarm evaluation called premature alarm state. For more information, see the following section. Avoiding premature transitions to alarm state CloudWatch alarm evaluation includes logic to try to avoid false alarms, where the alarm goes into ALARM state prematurely when data is intermittent. The example shown in row 5 in the tables in the previous section illustrate this logic. In those rows, and in the following examples, the Evaluation Periods is 3 and the evaluation range is 5 data points. Datapoints to Alarm is 3, except for the M out of N example, where Datapoints to Alarm is 2. Suppose an alarm's most recent data is - - - - X, with four missing data points and then a breaching data point as the most recent data point. Because the next data point may be non- breaching, the alarm does not go immediately into ALARM state when the data is either - - - - X or - - - X - and Datapoints to Alarm is 3. This way, false positives are avoided when the next data point is non-breaching and causes the data to be - - - X O or - - X - O. How alarm state is evaluated when data is missing 330 Amazon CloudWatch User Guide However, if the last few data points are - - X - -, the alarm goes into ALARM state even if missing data points are treated as missing. This is because alarms are designed to always go into ALARM state when the oldest available breaching datapoint during the Evaluation Periods number of data points is at least as old as the value of Datapoints to Alarm, and all other more recent data points are breaching or missing. In this case, the alarm goes into ALARM state even if the total number of datapoints available is lower than M (Datapoints to Alarm). This alarm logic applies to M out of N alarms as well. If the oldest breaching data point during the evaluation range is at least as old as the value of Datapoints to Alarm, and all of the more recent data points are either breaching or missing, the alarm goes into ALARM state no matter the value of M (Datapoints to Alarm). High-resolution alarms If you set an alarm on a high-resolution metric, you can specify a high-resolution alarm with a period of 10 seconds, 20 seconds, or 30 seconds, or you can set a regular alarm with a period of any multiple of 60 seconds. There is a higher charge for high-resolution alarms. For more information about high-resolution metrics, see Publish custom metrics. Alarms on math expressions You can set an alarm on the result of a math expression that is based on one or more CloudWatch metrics. A math expression used for an alarm can include as many as 10 metrics. Each metric must be using the same period. For an alarm based on a math expression, you can specify how you want CloudWatch to treat missing data points. In this case, the data point is considered missing if the math expression doesn't return a value for |
acw-ug-117 | acw-ug.pdf | 117 | higher charge for high-resolution alarms. For more information about high-resolution metrics, see Publish custom metrics. Alarms on math expressions You can set an alarm on the result of a math expression that is based on one or more CloudWatch metrics. A math expression used for an alarm can include as many as 10 metrics. Each metric must be using the same period. For an alarm based on a math expression, you can specify how you want CloudWatch to treat missing data points. In this case, the data point is considered missing if the math expression doesn't return a value for that data point. Alarms based on math expressions can't perform Amazon EC2 actions. For more information about metric math expressions and syntax, see Using math expressions with CloudWatch metrics. Percentile-based CloudWatch alarms and low data samples When you set a percentile as the statistic for an alarm, you can specify what to do when there is not enough data for a good statistical assessment. You can choose to have the alarm evaluate the High-resolution alarms 331 Amazon CloudWatch User Guide statistic anyway and possibly change the alarm state. Or, you can have the alarm ignore the metric while the sample size is low, and wait to evaluate it until there is enough data to be statistically significant. For percentiles between 0.5 (inclusive) and 1.00 (exclusive), this setting is used when there are fewer than 10/(1-percentile) data points during the evaluation period. For example, this setting would be used if there were fewer than 1000 samples for an alarm on a p99 percentile. For percentiles between 0 and 0.5 (exclusive), the setting is used when there are fewer than 10/ percentile data points. Common features of CloudWatch alarms The following features apply to all CloudWatch alarms: • There is no limit to the number of alarms that you can create. To create or update an alarm, you use the CloudWatch console, the PutMetricAlarm API action, or the put-metric-alarm command in the AWS CLI. • Alarm names must contain only UTF-8 characters, and can't contain ASCII control characters • You can list any or all of the currently configured alarms, and list any alarms in a particular state by using the CloudWatch console, the DescribeAlarms API action, or the describe-alarms command in the AWS CLI. • You can disable and enable alarm actions by using the DisableAlarmActions and EnableAlarmActions API actions, or the disable-alarm-actions and enable-alarm-actions commands in the AWS CLI. • You can test an alarm by setting it to any state using the SetAlarmState API action or the set- alarm-state command in the AWS CLI. This temporary state change lasts only until the next alarm comparison occurs. • You can create an alarm for a custom metric before you've created that custom metric. For the alarm to be valid, you must include all of the dimensions for the custom metric in addition to the metric namespace and metric name in the alarm definition. To do this, you can use the PutMetricAlarm API action, or the put-metric-alarm command in the AWS CLI. • You can view an alarm's history using the CloudWatch console, the DescribeAlarmHistory API action, or the describe-alarm-history command in the AWS CLI. CloudWatch preserves alarm history for 30 days. Each state transition is marked with a unique timestamp. In rare cases, your history might show more than one notification for a state change. The timestamp enables you to confirm unique state changes. Common features of CloudWatch alarms 332 Amazon CloudWatch User Guide • You can favorite alarms from the Favorites and recents option in the CloudWatch console navigation pane by hovering over the alarm that you want to favorite and choosing the star symbol next to it. • Alarms have an evaluation period quota. The evaluation period is calculated by multiplying the alarm period by the number of evaluation periods used. • The maximum evaluation period is seven days for alarms with a period of at least one hour (3600 seconds). • The maximum evaluation period is one day for alarms with a shorter period. • The maximum evaluation period is one day for alarms that use the custom Lambda data source. Note Some AWS resources don't send metric data to CloudWatch under certain conditions. For example, Amazon EBS might not send metric data for an available volume that is not attached to an Amazon EC2 instance, because there is no metric activity to be monitored for that volume. If you have an alarm set for such a metric, you might notice its state change to INSUFFICIENT_DATA. This might indicate that your resource is inactive, and might not necessarily mean that there is a problem. You can specify how each alarm treats missing data. For more information, see Configuring how CloudWatch alarms treat missing data. Best practice alarm |
acw-ug-118 | acw-ug.pdf | 118 | metric data to CloudWatch under certain conditions. For example, Amazon EBS might not send metric data for an available volume that is not attached to an Amazon EC2 instance, because there is no metric activity to be monitored for that volume. If you have an alarm set for such a metric, you might notice its state change to INSUFFICIENT_DATA. This might indicate that your resource is inactive, and might not necessarily mean that there is a problem. You can specify how each alarm treats missing data. For more information, see Configuring how CloudWatch alarms treat missing data. Best practice alarm recommendations for AWS services CloudWatch provides out-of-the box alarm recommendations. These are CloudWatch alarms that we recommend that you create for metrics that are published by other AWS services. These recommendations can help you identify the metrics that you should set alarms for to follow best practices for monitoring. The recommendations also suggest the alarm thresholds to set. Following these recommendations can help you not miss important monitoring of your AWS infrastructure. To find the alarm recommendations, you use the metrics section of the CloudWatch console, and select the alarm recommendations filter toggle. If you navigate to the recommended alarms in the console and then create a recommended alarm, CloudWatch can pre-fill some of the alarm settings. For some recommended alarms, the alarm threshold value is also pre-filled. You can also Alarm recommendations for AWS services 333 Amazon CloudWatch User Guide use the console to download infrastructure-as-code alarm definitions for recommended alarms, and then use this code to create the alarm in AWS CloudFormation, the AWS CLI, or Terraform. You can also see the list of recommended alarms in Recommended alarms. You are charged for the alarms that you create, at the same rate as any other alarms that you create in CloudWatch. Using the recommendations incurs no extra charges. For more information, see Amazon CloudWatch Pricing. Find and create recommended alarms Follow these steps to find the metrics that CloudWatch recommends that you set alarms for, and optionally to create one of these alarms. The first procedure explains how to find the metrics that have recommended alarms, and how to create one of these alarms. You can also get a bulk download of infrastructure-as-code alarm definitions for all recommended alarms in an AWS namespace, such as AWS/Lambda or AWS/S3. Those instructions are later in this topic. To find the metrics with recommended alarms, and create a single recommended alarm 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Above the Metrics table, Choose Alarm recommendations. The list of metric namespaces is filtered to include only the metrics that have alarm recommendations and that services in your account are publishing. 4. Choose the namespace for a service. The list of metrics under this namespace is filtered to include only those that have alarm recommendations. To see the alarm intent and recommended threshold for a metric, choose View details. To create an alarm for one of the metrics, do one of the following: • To use the console to create the alarm, do the following: 5. 6. a. Select the checkbox for the metric and choose the Graphed metrics tab. b. Choose the alarm icon. Find and create recommended alarms 334 Amazon CloudWatch User Guide The alarm creation wizard appears, with the metric name, statistic, and period filled in based on the alarm recommendation. If the recommendation includes a specific threshold value, that value is also pre-filled. c. Choose Next. d. Under Notification, select an SNS topic to notify when the alarm transitions to ALARM state, OK state, or INSUFFICIENT_DATA state. To have the alarm send multiple notifications for the same alarm state or for different alarm states, choose Add notification. To have the alarm not send notifications, choose Remove. e. To have the alarm perform Auto Scaling or EC2 actions, choose the appropriate button and choose the alarm state and action to perform. f. When finished, choose Next. g. Enter a name and description for the alarm. The name must contain only ASCII characters. Then choose Next. h. Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm. • To download an infrastructure-as-code alarm definition to use in either AWS CloudFormation, AWS CLI, or Terraform, choose Download alarm code and select the format that you want. The downloaded code will have the recommended settings for the metric name, statistic, and threshold. To download infrastructure-as-code alarm definitions for all recommended alarms for an AWS service 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. Find and create recommended alarms 335 Amazon CloudWatch User Guide 3. Above the Metrics table, Choose Alarm recommendations. The list of metric namespaces is |
acw-ug-119 | acw-ug.pdf | 119 | then choose Create alarm. • To download an infrastructure-as-code alarm definition to use in either AWS CloudFormation, AWS CLI, or Terraform, choose Download alarm code and select the format that you want. The downloaded code will have the recommended settings for the metric name, statistic, and threshold. To download infrastructure-as-code alarm definitions for all recommended alarms for an AWS service 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. Find and create recommended alarms 335 Amazon CloudWatch User Guide 3. Above the Metrics table, Choose Alarm recommendations. The list of metric namespaces is filtered to include only the metrics that have alarm recommendations and that services in your account are publishing. 4. Choose the namespace for a service. The list of metrics under this namespace is filtered to include only those that have alarm recommendations. 5. The Download alarm code displays how many alarms are recommended for the metrics in this namespace. To download infrastructure-as-code alarm definitions for all recommended alarms, choose Download alarm code and then choose the code format that you want. Recommended alarms The following sections list the metrics that we recommend that you set best practice alarms for. For each metric, the dimensions, alarm intent, recommended threshold, threshold justification, and the period length and number of datapoints is also displayed. Some metrics might appear twice in the list. This happens when different alarms are recommended for different combinations of dimensions of that metric. Datapoints to alarm is the number of data points that must be breaching to send the alarm into ALARM state. Evaluation periods is the number of periods that are taken into account when the alarm is evaluated. If these numbers are the same, the alarm goes into ALARM state only when that number of consecutive periods have values that breach the threshold. If Datapoints to alarm is lower than Evaluation periods, then it is an "M out of N" alarm and the alarm goes into ALARM state if at least Datapoints to alarm data points are breaching within any Evaluation periods set of data points. For more information, see Evaluating an alarm. Topics • Amazon API Gateway • Amazon EC2 Auto Scaling • AWS Certificate Manager (ACM) • Amazon CloudFront • Amazon Cognito • Amazon DynamoDB Recommended alarms 336 Amazon CloudWatch • Amazon EBS • Amazon EC2 • Amazon ElastiCache • Amazon ECS • Amazon ECS with Container Insights • Amazon ECS with Container Insights with enhanced observability User Guide • Amazon EFS • Amazon EKS with Container Insights • Amazon EventBridge Scheduler • Amazon Kinesis Data Streams • Lambda • Lambda Insights • Amazon VPC (AWS/NATGateway) • AWS Private Link (AWS/PrivateLinkEndpoints) • AWS Private Link (AWS/PrivateLinkServices) • Amazon RDS • Amazon Route 53 Public Data Plane • Amazon S3 • S3ObjectLambda • Amazon SNS • Amazon SQS • AWS VPN Amazon API Gateway 4XXError Dimensions: ApiName, Stage Alarm description: This alarm detects a high rate of client-side errors. This can indicate an issue in the authorization or client request parameters. It could also mean that a resource was removed or a client is requesting one that doesn't exist. Consider enabling CloudWatch Logs and checking for any errors that may be causing the 4XX errors. Moreover, consider enabling Recommended alarms 337 Amazon CloudWatch User Guide detailed CloudWatch metrics to view this metric per resource and method and narrow down the source of the errors. Errors could also be caused by exceeding the configured throttling limit. If the responses and logs are reporting high and unexpected rates of 429 errors, follow this guide to troubleshoot this issue. Intent: This alarm can detect high rates of client-side errors for the API Gateway requests. Statistic: Average Recommended threshold: 0.05 Threshold justification: The suggested threshold detects when more than 5% of total requests are getting 4XX errors. However, you can tune the threshold to suit the traffic of the requests as well as acceptable error rates. You can also analyze historical data to determine the acceptable error rate for the application workload and then tune the threshold accordingly. Frequently occurring 4XX errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD 5XXError Dimensions: ApiName, Stage Alarm description: This alarm helps to detect a high rate of server-side errors. This can indicate that there is something wrong on the API backend, the network, or the integration between the API gateway and the backend API. This documentation can help you troubleshoot the cause of 5xx errors. Intent: This alarm can detect high rates of server-side errors for the API Gateway requests. Statistic: Average Recommended threshold: 0.05 Threshold justification: The suggested threshold detects when more than 5% of |
acw-ug-120 | acw-ug.pdf | 120 | to be too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD 5XXError Dimensions: ApiName, Stage Alarm description: This alarm helps to detect a high rate of server-side errors. This can indicate that there is something wrong on the API backend, the network, or the integration between the API gateway and the backend API. This documentation can help you troubleshoot the cause of 5xx errors. Intent: This alarm can detect high rates of server-side errors for the API Gateway requests. Statistic: Average Recommended threshold: 0.05 Threshold justification: The suggested threshold detects when more than 5% of total requests are getting 5XX errors. However, you can tune the threshold to suit the traffic of the requests as Recommended alarms 338 Amazon CloudWatch User Guide well as acceptable error rates. you can also analyze historical data to determine the acceptable error rate for the application workload and then tune the threshold accordingly. Frequently occurring 5XX errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: GREATER_THAN_THRESHOLD Count Dimensions: ApiName, Stage Alarm description: This alarm helps to detect low traffic volume for the REST API stage. This can be an indicator of an issue with the application calling the API such as using incorrect endpoints. It could also be an indicator of an issue with the configuration or permissions of the API making it unreachable for clients. Intent: This alarm can detect unexpectedly low traffic volume for the REST API stage. We recommend that you create this alarm if your API receives a predictable and consistent number of requests under normal conditions. If you have detailed CloudWatch metrics enabled and you can predict the normal traffic volume per method and resource, we recommend that you create alternative alarms to have more fine-grained monitoring of traffic volume drops for each resource and method. This alarm is not recommended for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold justification: Set the threshold based on historical data analysis to determine what the expected baseline request count for your API is. Setting the threshold at a very high value might cause the alarm to be too sensitive at periods of normal and expected low traffic. Conversely, setting it at a very low value might cause the alarm to miss anomalous smaller drops in traffic volume. Period: 60 Recommended alarms 339 Amazon CloudWatch Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD Count Dimensions: ApiName, Stage, Resource, Method User Guide Alarm description: This alarm helps to detect low traffic volume for the REST API resource and method in the stage. This can indicate an issue with the application calling the API such as using incorrect endpoints. It could also be an indicator of an issue with the configuration or permissions of the API making it unreachable for clients. Intent: This alarm can detect unexpectedly low traffic volume for the REST API resource and method in the stage. We recommend that you create this alarm if your API receives a predictable and consistent number of requests under normal conditions. This alarm is not recommended for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold justification: Set the threshold based on historical data analysis to determine what the expected baseline request count for your API is. Setting the threshold at a very high value might cause the alarm to be too sensitive at periods of normal and expected low traffic. Conversely, setting it at a very low value might cause the alarm to miss anomalous smaller drops in traffic volume. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD Count Dimensions: ApiId, Stage Alarm description: This alarm helps to detect low traffic volume for the HTTP API stage. This can indicate an issue with the application calling the API such as using incorrect endpoints. It Recommended alarms 340 Amazon CloudWatch User Guide could also be an indicator of an issue with the configuration or permissions of the API making it unreachable for clients. Intent: This alarm can detect unexpectedly low traffic volume for the HTTP API stage. We recommend that you create this alarm if your API receives a predictable and consistent number of requests under normal conditions. If you have detailed CloudWatch metrics enabled and you can predict the normal traffic volume per route, we recommend that you create alternative alarms to this in order to have more fine-grained monitoring of traffic volume drops for each route. This alarm is not recommended for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold |
acw-ug-121 | acw-ug.pdf | 121 | for clients. Intent: This alarm can detect unexpectedly low traffic volume for the HTTP API stage. We recommend that you create this alarm if your API receives a predictable and consistent number of requests under normal conditions. If you have detailed CloudWatch metrics enabled and you can predict the normal traffic volume per route, we recommend that you create alternative alarms to this in order to have more fine-grained monitoring of traffic volume drops for each route. This alarm is not recommended for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold justification: Set the threshold value based on historical data analysis to determine what the expected baseline request count for your API is. Setting the threshold at a very high value might cause the alarm to be too sensitive at periods of normal and expected low traffic. Conversely, setting it at a very low value might cause the alarm to miss anomalous smaller drops in traffic volume. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD Count Dimensions: ApiId, Stage, Resource, Method Alarm description: This alarm helps to detect low traffic volume for the HTTP API route in the stage. This can indicate an issue with the application calling the API such as using incorrect endpoints. It could also indicate an issue with the configuration or permissions of the API making it unreachable for clients. Intent: This alarm can detect unexpectedly low traffic volume for the HTTP API route in the stage. We recommend that you create this alarm if your API receives a predictable and consistent number of requests under normal conditions. This alarm is not recommended for APIs that don't expect constant and consistent traffic. Recommended alarms 341 Amazon CloudWatch Statistic: SampleCount Recommended threshold: Depends on your situation User Guide Threshold justification: Set the threshold value based on historical data analysis to determine what the expected baseline request count for your API is. Setting the threshold at a very high value might cause the alarm to be too sensitive at periods of normal and expected low traffic. Conversely, setting it at a very low value might cause the alarm to miss anomalous smaller drops in traffic volume. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD IntegrationLatency Dimensions: ApiId, Stage Alarm description: This alarm helps to detect if there is high integration latency for the API requests in a stage. You can correlate the IntegrationLatency metric value with the corresponding latency metric of your backend such as the Duration metric for Lambda integrations. This helps you determine whether the API backend is taking more time to process requests from clients due to performance issues, or if there is some other overhead from initialization or cold start. Additionally, consider enabling CloudWatch Logs for your API and checking the logs for any errors that may be causing the high latency issues. Moreover, consider enabling detailed CloudWatch metrics to get a view of this metric per route, to help you narrow down the source of the integration latency. Intent: This alarm can detect when the API Gateway requests in a stage have a high integration latency. We recommend this alarm for WebSocket APIs, and we consider it optional for HTTP APIs because they already have separate alarm recommendations for the Latency metric. If you have detailed CloudWatch metrics enabled and you have different integration latency performance requirements per route, we recommend that you create alternative alarms in order to have more fine-grained monitoring of the integration latency for each route. Statistic: p90 Recommended threshold: 2000.0 Recommended alarms 342 Amazon CloudWatch User Guide Threshold justification: The suggested threshold value does not work for all the API workloads. However, you can use it as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance, and SLA requirements for the API. If is acceptable for the API to have a higher latency in general, set a higher threshold value to make the alarm less sensitive. However, if the API is expected to provide near real-time responses, set a lower threshold value. You can also analyze historical data to determine the expected baseline latency for the application workload, and then used to tune the threshold value accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD IntegrationLatency Dimensions: ApiId, Stage, Route Alarm description: This alarm helps to detect if there is high integration latency for the WebSocket API requests for a route in a stage. You can correlate the IntegrationLatency metric value with the corresponding latency metric of your backend such as the Duration metric for Lambda integrations. This helps you determine whether the API backend is taking more time to process requests from clients due |
acw-ug-122 | acw-ug.pdf | 122 | determine the expected baseline latency for the application workload, and then used to tune the threshold value accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD IntegrationLatency Dimensions: ApiId, Stage, Route Alarm description: This alarm helps to detect if there is high integration latency for the WebSocket API requests for a route in a stage. You can correlate the IntegrationLatency metric value with the corresponding latency metric of your backend such as the Duration metric for Lambda integrations. This helps you determine whether the API backend is taking more time to process requests from clients due to performance issues or if there is some other overhead from initialization or cold start. Additionally, consider enabling CloudWatch Logs for your API and checking the logs for any errors that may be causing the high latency issues. Intent: This alarm can detect when the API Gateway requests for a route in a stage have high integration latency. Statistic: p90 Recommended threshold: 2000.0 Threshold justification: The suggested threshold value does not work for all the API workloads. However, you can use it as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance, and SLA requirements for the API. If it is acceptable for the API to have a higher latency in general, you can set a higher threshold value to make the alarm less sensitive. However, if the API is Recommended alarms 343 Amazon CloudWatch User Guide expected to provide near real-time responses, set a lower threshold value. You can also analyze historical data to determine the expected baseline latency for the application workload, and then used to tune the threshold value accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Latency Dimensions: ApiName, Stage Alarm description: This alarm detects high latency in a stage. Find the IntegrationLatency metric value to check the API backend latency. If the two metrics are mostly aligned, the API backend is the source of higher latency and you should investigate there for issues. Consider also enabling CloudWatch Logs and checking for errors that might be causing the high latency. Moreover, consider enabling detailed CloudWatch metrics to view this metric per resource and method and narrow down the source of the latency. If applicable, refer to the troubleshooting with Lambda or troubleshooting for edge-optimized API endpoints guides. Intent: This alarm can detect when the API Gateway requests in a stage have high latency. If you have detailed CloudWatch metrics enabled and you have different latency performance requirements for each method and resource, we recommend that you create alternative alarms to have more fine-grained monitoring of the latency for each resource and method. Statistic: p90 Recommended threshold: 2500.0 Threshold justification: The suggested threshold value does not work for all API workloads. However, you can use it as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance, and SLA requirements for the API. If it is acceptable for the API to have a higher latency in general, you can set a higher threshold value to make the alarm less sensitive. However, if the API is expected to provide near real-time responses, set a lower threshold value. You can also analyze historical data to determine what the expected baseline latency is for the application workload and then tune the threshold value accordingly. Recommended alarms 344 Amazon CloudWatch Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 User Guide Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Latency Dimensions: ApiName, Stage, Resource, Method Alarm description: This alarm detects high latency for a resource and method in a stage. Find the IntegrationLatency metric value to check the API backend latency. If the two metrics are mostly aligned, the API backend is the source of higher latency and you should investigate there for performance issues. Consider also enabling CloudWatch Logs and checking for any errors that might be causing the high latency. You can also refer to the troubleshooting with Lambda or troubleshooting for edge-optimized API endpoints guides if applicable. Intent: This alarm can detect when the API Gateway requests for a resource and method in a stage have high latency. Statistic: p90 Recommended threshold: 2500.0 Threshold justification: The suggested threshold value does not work for all the API workloads. However, you can use it as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance, and SLA requirements for the API. If it is acceptable for the API to have a higher latency in general, you can set a higher threshold value to make the alarm less sensitive. However, if the API is expected to provide near real-time responses, set a lower threshold value. You can |
acw-ug-123 | acw-ug.pdf | 123 | have high latency. Statistic: p90 Recommended threshold: 2500.0 Threshold justification: The suggested threshold value does not work for all the API workloads. However, you can use it as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance, and SLA requirements for the API. If it is acceptable for the API to have a higher latency in general, you can set a higher threshold value to make the alarm less sensitive. However, if the API is expected to provide near real-time responses, set a lower threshold value. You can also analyze historical data to determine the expected baseline latency for the application workload and then tune the threshold value accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Recommended alarms 345 Amazon CloudWatch Latency Dimensions: ApiId, Stage User Guide Alarm description: This alarm detects high latency in a stage. Find the IntegrationLatency metric value to check the API backend latency. If the two metrics are mostly aligned, the API backend is the source of higher latency and you should investigate there for performance issues. Consider also enabling CloudWatch Logs and checking for any errors that may be causing the high latency. Moreover, consider enabling detailed CloudWatch metrics to view this metric per route and narrow down the source of the latency. You can also refer to the troubleshooting with Lambda integrations guide if applicable. Intent: This alarm can detect when the API Gateway requests in a stage have high latency. If you have detailed CloudWatch metrics enabled and you have different latency performance requirements per route, we recommend that you create alternative alarms to have more fine- grained monitoring of the latency for each route. Statistic: p90 Recommended threshold: 2500.0 Threshold justification: The suggested threshold value does not work for all the API workloads. However, it can be used as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance and SLA requirements for the API. If it is acceptable for the API to have a higher latency in general, you can set a higher threshold value to make it less sensitive.However, if the API is expected to provide near real-time responses, set a lower threshold value. You can also analyze historical data to determine the expected baseline latency for the application workload and then tune the threshold value accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Latency Dimensions: ApiId, Stage, Resource, Method Recommended alarms 346 Amazon CloudWatch User Guide Alarm description: This alarm detects high latency for a route in a stage. Find the IntegrationLatency metric value to check the API backend latency. If the two metrics are mostly aligned, the API backend is the source of higher latency and should be investigated for performance issues. Consider also enabling CloudWatch logs and checking for any errors that might be causing the high latency. You can also refer to the troubleshooting with Lambda integrations guide if applicable. Intent: This alarm is used to detect when the API Gateway requests for a route in a stage have high latency. Statistic: p90 Recommended threshold: 2500.0 Threshold justification: The suggested threshold value does not work for all the API workloads. However, it can be used as a starting point for the threshold. You can then choose different threshold values based on the workload and acceptable latency, performance, and SLA requirements for the API. If it is acceptable for the API to have a higher latency in general, you can set a higher threshold value to make the alarm less sensitive. However, if the API is expected to provide near real-time responses, set a lower threshold value. You can also analyze historical data to determine the expected baseline latency for the application workload and then tune the threshold value accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD 4xx Dimensions: ApiId, Stage Alarm description: This alarm detects a high rate of client-side errors. This can indicate an issue in the authorization or client request parameters. It could also mean that a route was removed or a client is requesting one that doesn't exist in the API. Consider enabling CloudWatch Logs and checking for any errors that may be causing the 4xx errors. Moreover, consider enabling detailed CloudWatch metrics to view this metric per route, to help you narrow down the source of the errors. Errors can also be caused by exceeding the configured throttling limit. If the Recommended alarms 347 Amazon CloudWatch User Guide responses and logs are reporting high and unexpected rates of 429 errors, follow this guide to troubleshoot this issue. Intent: This alarm can detect high rates of client-side errors for the API Gateway requests. Statistic: |
acw-ug-124 | acw-ug.pdf | 124 | one that doesn't exist in the API. Consider enabling CloudWatch Logs and checking for any errors that may be causing the 4xx errors. Moreover, consider enabling detailed CloudWatch metrics to view this metric per route, to help you narrow down the source of the errors. Errors can also be caused by exceeding the configured throttling limit. If the Recommended alarms 347 Amazon CloudWatch User Guide responses and logs are reporting high and unexpected rates of 429 errors, follow this guide to troubleshoot this issue. Intent: This alarm can detect high rates of client-side errors for the API Gateway requests. Statistic: Average Recommended threshold: 0.05 Threshold justification: The suggested threshold detects when more than 5% of total requests are getting 4xx errors. However, you can tune the threshold to suit the traffic of the requests as well as acceptable error rates. You can also analyze historical data to determine the acceptable error rate for the application workload and then tune the threshold accordingly. Frequently occurring 4xx errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD 5xx Dimensions: ApiId, Stage Alarm description: This alarm helps to detect a high rate of server-side errors. This can indicate that there is something wrong on the API backend, the network, or the integration between the API gateway and the backend API. This documentation can help you troubleshoot the cause for 5xx errors. Intent: This alarm can detect high rates of server-side errors for the API Gateway requests. Statistic: Average Recommended threshold: 0.05 Threshold justification: The suggested threshold detects when more than 5% of total requests are getting 5xx errors. However, you can tune the threshold to suit the traffic of the requests as well as acceptable error rates. You can also analyze historical data to determine what the Recommended alarms 348 Amazon CloudWatch User Guide acceptable error rate is for the application workload, and then you can tune the threshold accordingly. Frequently occurring 5xx errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: GREATER_THAN_THRESHOLD MessageCount Dimensions: ApiId, Stage Alarm description: This alarm helps to detect low traffic volume for the WebSocket API stage. This can indicate an issue when clients call the API such as using incorrect endpoints, or issues with the backend sending messages to clients. It could also indicate an issue with the configuration or permissions of the API, making it unreachable for clients. Intent: This alarm can detect unexpectedly low traffic volume for the WebSocket API stage. We recommend that you create this alarm if your API receives and sends a predictable and consistent number of messages under normal conditions. If you have detailed CloudWatch metrics enabled and you can predict the normal traffic volume per route, it is better to create alternative alarms to this one, in order to have more fine-grained monitoring of traffic volume drops for each route. We do not recommend this alarm for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold justification: Set the threshold value based on historical data analysis to determine what the expected baseline message count for your API is. Setting the threshold to a very high value might cause the alarm to be too sensitive at periods of normal and expected low traffic. Conversely, setting it to a very low value might cause the alarm to miss anomalous smaller drops in traffic volume. Period: 60 Datapoints to alarm: 10 Recommended alarms 349 Amazon CloudWatch Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD MessageCount Dimensions: ApiId, Stage, Route User Guide Alarm description: This alarm helps detect low traffic volume for the WebSocket API route in the stage. This can indicate an issue with the clients calling the API such as using incorrect endpoints, or issues with the backend sending messages to clients. It could also indicate an issue with the configuration or permissions of the API, making it unreachable for clients. Intent: This alarm can detect unexpectedly low traffic volume for the WebSocket API route in the stage. We recommend that you create this alarm if your API receives and sends a predictable and consistent number of messages under normal conditions. We do not recommend this alarm for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold justification: Set the threshold based on historical data analysis to determine what the expected baseline message count for your API is. Setting the threshold to a very high value might cause the alarm to be too sensitive at periods of normal |
acw-ug-125 | acw-ug.pdf | 125 | unexpectedly low traffic volume for the WebSocket API route in the stage. We recommend that you create this alarm if your API receives and sends a predictable and consistent number of messages under normal conditions. We do not recommend this alarm for APIs that don't expect constant and consistent traffic. Statistic: SampleCount Recommended threshold: Depends on your situation Threshold justification: Set the threshold based on historical data analysis to determine what the expected baseline message count for your API is. Setting the threshold to a very high value might cause the alarm to be too sensitive at periods of normal and expected low traffic. Conversely, setting it to a very low value might cause the alarm to miss anomalous smaller drops in traffic volume. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD ClientError Dimensions: ApiId, Stage Alarm description: This alarm detects a high rate of client errors. This can indicate an issue in the authorization or message parameters. It could also mean that a route was removed or a client is requesting one that doesn't exist in the API. Consider enabling CloudWatch Logs Recommended alarms 350 Amazon CloudWatch User Guide and checking for any errors that may be causing the 4xx errors. Moreover, consider enabling detailed CloudWatch metrics to view this metric per route, to help you narrow down the source of the errors. Errors could also be caused by exceeding the configured throttling limit. If the responses and logs are reporting high and unexpected rates of 429 errors, follow this guide to troubleshoot this issue. Intent: This alarm can detect high rates of client errors for the WebSocket API Gateway messages. Statistic: Average Recommended threshold: 0.05 Threshold justification: The suggested threshold detects when more than 5% of total requests are getting 4xx errors. You can tune the threshold to suit the traffic of the requests as well as to suit your acceptable error rates. You can also analyze historical data to determine the acceptable error rate for the application workload, and then tune the threshold accordingly. Frequently occurring 4xx errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ExecutionError Dimensions: ApiId, Stage Alarm description: This alarm helps to detect a high rate of execution errors. This can be caused by 5xx errors from your integration, permission issues, or other factors preventing successful invocation of the integration, such as the integration being throttled or deleted. Consider enabling CloudWatch Logs for your API and checking the logs for the type and cause of the errors. Moreover, consider enabling detailed CloudWatch metrics to get a view of this metric per route, to help you narrow down the source of the errors. This documentation can also help you troubleshoot the cause of any connection errors. Intent: This alarm can detect high rates of execution errors for the WebSocket API Gateway messages. Recommended alarms 351 Amazon CloudWatch Statistic: Average Recommended threshold: 0.05 User Guide Threshold justification: The suggested threshold detects when more than 5% of total requests are getting execution errors. You can tune the threshold to suit the traffic of the requests, as well as to suit your acceptable error rates. You can analyze historical data to determine the acceptable error rate for the application workload, and then tune the threshold accordingly. Frequently occurring execution errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: GREATER_THAN_THRESHOLD Amazon EC2 Auto Scaling GroupInServiceCapacity Dimensions: AutoScalingGroupName Alarm description: This alarm helps to detect when the capacity in the group is below the desired capacity required for your workload. To troubleshoot, check your scaling activities for launch failures and confirm that your desired capacity configuration is correct. Intent: This alarm can detect a low availability in your auto scaling group because of launch failures or suspended launches. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The threshold value should be the minimum capacity required to run your workload. In most cases, you can set this to match the GroupDesiredCapacity metric. Period: 60 Recommended alarms 352 User Guide Amazon CloudWatch Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD AWS Certificate Manager (ACM) DaysToExpiry Dimensions: CertificateArn Alarm description: This alarm helps you detect when a certificate managed by or imported into ACM is approaching its expiration date. It helps to prevent unexpected certificate expirations that could lead to service disruptions. When the alarm transitions into ALARM state, you should take immediate action to renew or re-import the certificate. For ACM-managed certificates, see the instructions at certificate renewal process. For imported certificates, |
acw-ug-126 | acw-ug.pdf | 126 | you can set this to match the GroupDesiredCapacity metric. Period: 60 Recommended alarms 352 User Guide Amazon CloudWatch Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD AWS Certificate Manager (ACM) DaysToExpiry Dimensions: CertificateArn Alarm description: This alarm helps you detect when a certificate managed by or imported into ACM is approaching its expiration date. It helps to prevent unexpected certificate expirations that could lead to service disruptions. When the alarm transitions into ALARM state, you should take immediate action to renew or re-import the certificate. For ACM-managed certificates, see the instructions at certificate renewal process. For imported certificates, see the instructions at re-import process. Intent: This alarm can proactively alert you about upcoming certificate expirations. It provides sufficient advance notice to allow for manual intervention, enabling you to renew or replace certificates before they expire. This helps you maintain the security and availability of TLS- enabled services. When this goes into ALARM, immediately investigate the certificate status and initiate the renewal process if necessary. Statistic: Minimum Recommended threshold: 44.0 Threshold justification: The 44-day threshold provides a balance between early warning and avoiding false alarms. It allows sufficient time for manual intervention if automatic renewal fails. Adjust this value based on your certificate renewal process and operational response times. Period: 86400 Datapoints to alarm: 1 Evaluation periods: 1 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD Recommended alarms 353 Amazon CloudWatch Amazon CloudFront 5xxErrorRate User Guide Dimensions: DistributionId, Region=Global Alarm description: This alarm monitors the percentage of 5xx error responses from your origin server, to help you detect if the CloudFront service is having issues. See Troubleshooting error responses from your origin for information to help you understand the problems with your server. Also, turn on additional metrics to get detailed error metrics. Intent: This alarm is used to detect problems with serving requests from the origin server, or problems with communication between CloudFront and your origin server. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the tolerance for 5xx responses. You can analyze historical data and trends, and then set the threshold accordingly. Because 5xx errors can be caused by transient issues, we recommend that you set the threshold to a value greater than 0 so that the alarm is not too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD OriginLatency Dimensions: DistributionId, Region=Global Alarm description: The alarm helps to monitor if the origin server is taking too long to respond. If the server takes too long to respond, it might lead to a timeout. Refer to find and fix delayed responses from applications on your origin server if you experience consistently high OriginLatency values. Intent: This alarm is used to detect problems with the origin server taking too long to respond. Statistic: p90 Recommended alarms 354 Amazon CloudWatch User Guide Recommended threshold: Depends on your situation Threshold justification: You should calculate the value of about 80% of the origin response timeout, and use the result as the threshold value. If this metric is consistently close to the origin response timeout value, you might start experiencing 504 errors. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD FunctionValidationErrors Dimensions: DistributionId, FunctionName, Region=Global Alarm description: This alarm helps you monitor validation errors from CloudFront functions so that you can take steps to resolve them. Analyze the CloudWatch function logs and look at the function code to find and resolve the root cause of the problem. See Restrictions on edge functions to understand the common misconfigurations for CloudFront Functions. Intent: This alarm is used to detect validation errors from CloudFront functions. Statistic: Sum Recommended threshold: 0.0 Threshold justification: A value greater than 0 indicates a validation error. We recommend setting the threshold to 0 because validation errors imply a problem when CloudFront functions hand off back to CloudFront. For example, CloudFront needs the HTTP Host header in order to process a request. There is nothing stopping a user from deleting the Host header in their CloudFront functions code. But when CloudFront gets the response back and the Host header is missing, CloudFront throws a validation error. Period: 60 Datapoints to alarm: 2 Evaluation periods: 2 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 355 Amazon CloudWatch FunctionExecutionErrors User Guide Dimensions: DistributionId, FunctionName, Region=Global Alarm description: This alarm helps you monitor execution errors from CloudFront functions so that you can take steps to resolve them. Analyze the CloudWatch function logs and look at the function code to find and resolve the root cause of the problem. Intent: This alarm is used to detect execution errors from CloudFront functions. Statistic: Sum Recommended threshold: 0.0 Threshold justification: We recommend to set the threshold to 0 because an execution error indicates a problem with the code that occurs at runtime. Period: |
acw-ug-127 | acw-ug.pdf | 127 | 2 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 355 Amazon CloudWatch FunctionExecutionErrors User Guide Dimensions: DistributionId, FunctionName, Region=Global Alarm description: This alarm helps you monitor execution errors from CloudFront functions so that you can take steps to resolve them. Analyze the CloudWatch function logs and look at the function code to find and resolve the root cause of the problem. Intent: This alarm is used to detect execution errors from CloudFront functions. Statistic: Sum Recommended threshold: 0.0 Threshold justification: We recommend to set the threshold to 0 because an execution error indicates a problem with the code that occurs at runtime. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD FunctionThrottles Dimensions: DistributionId, FunctionName, Region=Global Alarm description: This alarm helps you to monitor if your CloudFront function is throttled. If your function is throttled, it means that it is taking too long to execute. To avoid function throttles, consider optimizing the function code. Intent: This alarm can detect when your CloudFront function is throttled so that you can react and resolve the issue for a smooth customer experience. Statistic: Sum Recommended threshold: 0.0 Threshold justification: We recommend setting the threshold to 0, to allow quicker resolution of the function throttles. Recommended alarms 356 User Guide Amazon CloudWatch Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon Cognito SignUpThrottles Dimensions: UserPool, UserPoolClient Alarm description: This alarm monitors the count of throttled requests. If users are consistently getting throttled, you should increase the limit by requesting a service quota increase. Refer to Quotas in Amazon Cognito to learn how to request a quota increase. To take actions proactively, consider tracking the usage quota. Intent: This alarm helps to monitor the occurrence of throttled sign-up requests. This can help you know when to take actions to mitigate any degradation in sign-up experience. Sustained throttling of requests is a negative user sign-up experience. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: A well-provisioned user pool should not encounter any throttling which spans across multiple data points. So, a typical threshold for an expected workload should be zero. For an irregular workload with frequent bursts, you can analyze historical data to determine the acceptable throttling for the application workload, and then you can tune the threshold accordingly. A throttled request should be retried to minimize the impact on the application. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 357 Amazon CloudWatch SignInThrottles Dimensions: UserPool, UserPoolClient User Guide Alarm description: This alarm monitors the count of throttled user authentication requests. If users are consistently getting throttled, you might need to increase the limit by requesting a service quota increase. Refer to Quotas in Amazon Cognito to learn how to request a quota increase. To take actions proactively, consider tracking the usage quota. Intent: This alarm helps to monitor the occurrence of throttled sign-in requests. This can help you know when to take actions to mitigate any degradation in sign-in experience. Sustained throttling of requests is a bad user authentication experience. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: A well-provisioned user pool should not encounter any throttling which spans across multiple data points. So, a typical threshold for an expected workload should be zero. For an irregular workload with frequent bursts, you can analyze historical data to determine the acceptable throttling for the application workload, and then you can tune the threshold accordingly. A throttled request should be retried to minimize the impact on the application. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TokenRefreshThrottles Dimensions: UserPool, UserPoolClient Alarm description: You can set the threshold value can to suit the traffic of the request as well as to match acceptable throttling for token refresh requests. Throttling is used to protect your system from too many requests. However, it is important to monitor if you are under provisioned for your normal traffic as well. You can analyze historical data to find the acceptable throttling for the application workload, and then you can tune your alarm threshold to be higher than your acceptable throttling level. Throttled requests should be retried by the Recommended alarms 358 Amazon CloudWatch User Guide application/service as they are transient. Therefore, a very low value for the threshold can cause alarm to be sensitive. Intent: This alarm helps to monitor the occurrence of throttled token refresh requests. This can help you know when to take actions to mitigate any potential problems, to ensure a smooth user experience and the health and reliability of your authentication system. Sustained throttling of requests is a bad user authentication experience. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Threshold value can also be set/tuned to suit the traffic of the request as well as acceptable throttling for |
acw-ug-128 | acw-ug.pdf | 128 | application/service as they are transient. Therefore, a very low value for the threshold can cause alarm to be sensitive. Intent: This alarm helps to monitor the occurrence of throttled token refresh requests. This can help you know when to take actions to mitigate any potential problems, to ensure a smooth user experience and the health and reliability of your authentication system. Sustained throttling of requests is a bad user authentication experience. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Threshold value can also be set/tuned to suit the traffic of the request as well as acceptable throttling for token refresh requests. Throttling are there for protecting your system from too many requests, however it is important to monitor if you are under provisioned for your normal traffic as well and see if it is causing the impact. Historical data can also be analyzed to see what is the acceptable throttling for the application workload and threshold can be tuned higher than your usual acceptable throttling level. Throttled requests should be retried by the application/service as they are transient. Therefore, a very low value for the threshold can cause alarm to be sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD FederationThrottles Dimensions: UserPool, UserPoolClient, IdentityProvider Alarm description: This alarm monitors the count of throttled identity federation requests. If you consistently see throttling, it might indicate that you need to increase the limit by requesting a service quota increase. Refer to Quotas in Amazon Cognito to learn how to request a quota increase. Intent: This alarm helps to monitor the occurrence of throttled identity federation requests. This can help you take proactive responses to performance bottlenecks or misconfigurations, and ensure a smooth authentication experience for your users. Sustained throttling of requests is a bad user authentication experience. Recommended alarms 359 Amazon CloudWatch Statistic: Sum User Guide Recommended threshold: Depends on your situation Threshold justification: You can set the threshold to suit the traffic of the request as well as to match the acceptable throttling for identity federation requests. Throttling is used for protecting your system from too many requests. However, it is important to monitor if you are under provisioned for your normal traffic as well. You can analyze historical data to find the acceptable throttling for the application workload, and then set the threshold to a value above your acceptable throttling level. Throttled requests should be retried by the application/ service as they are transient. Therefore, a very low value for the threshold can cause alarm to be sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon DynamoDB AccountProvisionedReadCapacityUtilization Dimensions: None Alarm description: This alarm detects if the account’s read capacity is reaching its provisioned limit. You can raise the account quota for read capacity utilization if this occurs. You can view your current quotas for read capacity units and request increases using Service Quotas. Intent: The alarm can detect if the account’s read capacity utilization is approaching its provisioned read capacity utilization. If the utilization reaches its maximum limit, DynamoDB starts to throttle read requests. Statistic: Maximum Recommended threshold: 80.0 Threshold justification: Set the threshold to 80%, so that action (such as raising the account limits) can be taken before it reaches full capacity to avoid throttling. Recommended alarms 360 Amazon CloudWatch Period: 300 Datapoints to alarm: 2 Evaluation periods: 2 Comparison Operator: GREATER_THAN_THRESHOLD AccountProvisionedWriteCapacityUtilization Dimensions: None User Guide Alarm description: This alarm detects if the account’s write capacity is reaching its provisioned limit. You can raise the account quota for write capacity utilization if this occurs. You can view your current quotas for write capacity units and request increases using Service Quotas. Intent: This alarm can detect if the account’s write capacity utilization is approaching its provisioned write capacity utilization. If the utilization reaches its maximum limit, DynamoDB starts to throttle write requests. Statistic: Maximum Recommended threshold: 80.0 Threshold justification: Set the threshold to 80%, so that the action (such as raising the account limits) can be taken before it reaches full capacity to avoid throttling. Period: 300 Datapoints to alarm: 2 Evaluation periods: 2 Comparison Operator: GREATER_THAN_THRESHOLD AgeOfOldestUnreplicatedRecord Dimensions: TableName, DelegatedOperation Alarm description: This alarm detects the delay in replication to a Kinesis data stream. Under normal operation, AgeOfOldestUnreplicatedRecord should be only milliseconds. This number grows based on unsuccessful replication attempts caused by customer-controlled configuration choices. Customer-controlled configuration examples that lead to unsuccessful replication attempts are an under-provisioned Kinesis data stream capacity that leads to Recommended alarms 361 Amazon CloudWatch User Guide excessive throttling. or a manual update to the Kinesis data stream’s access policies that prevents DynamoDB from adding data to the data stream. To keep this metric as low as possible, you need to ensure the right provisioning of Kinesis data stream capacity and |
acw-ug-129 | acw-ug.pdf | 129 | the delay in replication to a Kinesis data stream. Under normal operation, AgeOfOldestUnreplicatedRecord should be only milliseconds. This number grows based on unsuccessful replication attempts caused by customer-controlled configuration choices. Customer-controlled configuration examples that lead to unsuccessful replication attempts are an under-provisioned Kinesis data stream capacity that leads to Recommended alarms 361 Amazon CloudWatch User Guide excessive throttling. or a manual update to the Kinesis data stream’s access policies that prevents DynamoDB from adding data to the data stream. To keep this metric as low as possible, you need to ensure the right provisioning of Kinesis data stream capacity and make sure that DynamoDB’s permissions are unchanged. Intent: This alarm can monitor unsuccessful replication attempts and the resulting delay in replication to the Kinesis data stream. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the desired replication delay measured in milliseconds. This value depends on your workload's requirements and expected performance. Period: 300 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: GREATER_THAN_THRESHOLD FailedToReplicateRecordCount Dimensions: TableName, DelegatedOperation Alarm description: This alarm detects the number of records that DynamoDB failed to replicate to your Kinesis data stream. Certain items larger than 34 KB might expand in size to change data records that are larger than the 1 MB item size limit of Kinesis Data Streams. This size expansion occurs when these larger than 34 KB items include a large number of Boolean or empty attribute values. Boolean and empty attribute values are stored as 1 byte in DynamoDB, but expand up to 5 bytes when they’re serialized using standard JSON for Kinesis Data Streams replication. DynamoDB can’t replicate such change records to your Kinesis data stream. DynamoDB skips these change data records, and automatically continues replicating subsequent records. Intent: This alarm can monitor the number of records that DynamoDB failed to replicate to your Kinesis data stream because of the item size limit of Kinesis Data Streams. Statistic: Sum Recommended alarms 362 Amazon CloudWatch User Guide Recommended threshold: 0.0 Threshold justification: Set the threshold to 0 to detect any records that DynamoDB failed to replicate. Period: 60 Datapoints to alarm: 1 Evaluation periods: 1 Comparison Operator: GREATER_THAN_THRESHOLD ReadThrottleEvents Dimensions: TableName Alarm description: This alarm detects if there are high number of read requests getting throttled for the DynamoDB table. To troubleshoot the issue, see Troubleshooting throttling issues in Amazon DynamoDB. Intent: This alarm can detect sustained throttling for read requests to the DynamoDB table. Sustained throttling of read requests can negatively impact your workload read operations and reduce the overall efficiency of the system. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the expected read traffic for the DynamoDB table, accounting for an acceptable level of throttling. It is important to monitor whether you are under provisioned and not causing consistent throttling. You can also analyze historical data to find the acceptable throttling level for the application workload, and then tune the threshold to be higher than your usual throttling level. Throttled requests should be retried by the application or service as they are transient. Therefore, a very low threshold may cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 363 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD ReadThrottleEvents Dimensions: TableName, GlobalSecondaryIndexName Alarm description: This alarm detects if there are a high number of read requests getting throttled for the Global Secondary Index of the DynamoDB table. To troubleshoot the issue, see Troubleshooting throttling issues in Amazon DynamoDB. Intent: The alarm can detect sustained throttling for read requests for the Global Secondary Index of the DynamoDB Table. Sustained throttling of read requests can negatively impact your workload read operations and reduce the overall efficiency of the system. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the expected read traffic for the DynamoDB table, accounting for an acceptable level of throttling. It is important to monitor if you are under provisioned and not causing consistent throttling. You can also analyze historical data to find an acceptable throttling level for the application workload, and then tune the threshold to be higher than your usual acceptable throttling level. Throttled requests should be retried by the application or service as they are transient. Therefore, a very low threshold may cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ReplicationLatency Dimensions: TableName, ReceivingRegion Alarm description: The alarm detects if the replica in a Region for the global table is lagging behind the source Region. The latency can increase if an AWS Region becomes degraded and you have a replica table in that Region. In this case, you can |
acw-ug-130 | acw-ug.pdf | 130 | be higher than your usual acceptable throttling level. Throttled requests should be retried by the application or service as they are transient. Therefore, a very low threshold may cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ReplicationLatency Dimensions: TableName, ReceivingRegion Alarm description: The alarm detects if the replica in a Region for the global table is lagging behind the source Region. The latency can increase if an AWS Region becomes degraded and you have a replica table in that Region. In this case, you can temporarily redirect your application's read and write activity to a different AWS Region. If you are using 2017.11.29 (Legacy) of global tables, you should verify that write capacity units (WCUs) are identical for Recommended alarms 364 Amazon CloudWatch User Guide each of the replica tables. You can also make sure to follow recommendations in Best practices and requirements for managing capacity. Intent: The alarm can detect if the replica table in a Region is falling behind replicating the changes from another Region. This could cause your replica to diverge from the other replicas. It’s useful to know the replication latency of each AWS Region and alert if that replication latency increases continually. The replication of the table applies to global tables only. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on your use case. Replication latencies longer than 3 minutes are generally a cause for investigation. Review the criticality and requirements of replication delay and analyze historical trends, and then select the threshold accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD SuccessfulRequestLatency Dimensions: TableName, Operation Alarm description: This alarm detects a high latency for the DynamoDB table operation ( indicated by the dimension value of the Operation in the alarm). See this troubleshooting document for troubleshooting latency issues in Amazon DynamoDB. Intent: This alarm can detect a high latency for the DynamoDB table operation. Higher latency for the operations can negatively impact the overall efficiency of the system. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: DynamoDB provides single-digit millisecond latency on average for singleton operations such as GetItem, PutItem, and so on. However, you can set the threshold based on acceptable tolerance for the latency for the type of operation and table involved in Recommended alarms 365 Amazon CloudWatch User Guide the workload. You can analyze historical data of this metric to find the usual latency for the table operation, and then set the threshold to a number which represents critical delay for the operation. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD SystemErrors Dimensions: TableName Alarm description: This alarm detects a sustained high number of system errors for the DynamoDB table requests. If you continue to get 5xx errors, open the AWS Service Health Dashboard to check for operational issues with the service. You can use this alarm to get notified in case there is a prolonged internal service issue from DynamoDB and it helps you correlate with the issue your client application is facing. Refer Error handling for DynamoDB for more information. Intent: This alarm can detect sustained system errors for the DynamoDB table requests. System errors indicate internal service errors from DynamoDB and helps correlate to the issue that the client is having. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the expected traffic, accounting for an acceptable level of system errors. You can also analyze historical data to find the acceptable error count for the application workload, and then tune the threshold accordingly. System errors should be retried by the application/service as they are transient. Therefore, a very low threshold might cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Recommended alarms 366 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD ThrottledPutRecordCount Dimensions: TableName, DelegatedOperation Alarm description: This alarm detects the records getting throttled by your Kinesis data stream during the replication of change data capture to Kinesis. This throttling happens because of insufficient Kinesis data stream capacity. If you experience excessive and regular throttling, you might need to increase the number of Kinesis stream shards proportionally to the observed write throughput of your table. To learn more about determining the size of a Kinesis data stream, see Determining the Initial Size of a Kinesis Data Stream. Intent: This alarm can monitor the number of records that that were throttled by your Kinesis data stream because of insufficient Kinesis data stream capacity. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: You might experience some throttling during exceptional usage peaks, but throttled records should |
acw-ug-131 | acw-ug.pdf | 131 | data stream capacity. If you experience excessive and regular throttling, you might need to increase the number of Kinesis stream shards proportionally to the observed write throughput of your table. To learn more about determining the size of a Kinesis data stream, see Determining the Initial Size of a Kinesis Data Stream. Intent: This alarm can monitor the number of records that that were throttled by your Kinesis data stream because of insufficient Kinesis data stream capacity. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: You might experience some throttling during exceptional usage peaks, but throttled records should remain as low as possible to avoid higher replication latency (DynamoDB retries sending throttled records to the Kinesis data stream). Set the threshold to a number which can help you catch regular excessive throttling. You can also analyze historical data of this metric to find the acceptable throttling rates for the application workload. Tune the threshold to a value that the application can tolerate based on your use case. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD UserErrors Dimensions: None Alarm description: This alarm detects a sustained high number of user errors for the DynamoDB table requests. You can check client application logs during the issue time frame to see why the requests are invalid. You can check HTTP status code 400 to see the type of error Recommended alarms 367 Amazon CloudWatch User Guide you are getting and take action accordingly. You might have to fix the application logic to create valid requests. Intent: This alarm can detect sustained user errors for the DynamoDB table requests. User errors for requested operations mean that the client is producing invalid requests and it is failing. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold to zero to detect any client side errors. Or you can set it to a higher value if you want to avoid the alarm triggering for a very lower number of errors. Decide based on your use case and traffic for the requests. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD WriteThrottleEvents Dimensions: TableName Alarm description: This alarm detects if there are a high number of write requests getting throttled for the DynamoDB table. See Troubleshooting throttling issues in Amazon DynamoDB to troubleshoot the issue. Intent: This alarm can detect sustained throttling for write requests to the DynamoDB table. Sustained throttling of write requests can negatively impact your workload write operations and reduce the overall efficiency of the system. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the expected write traffic for the DynamoDB table, accounting for an acceptable level of throttling. It is important to monitor if you are under provisioned and not causing consistent throttling. You can also analyze Recommended alarms 368 Amazon CloudWatch User Guide historical data to find the acceptable level of throttling for the application workload, and then tune the threshold to a value higher than your usual acceptable throttling level. Throttled requests should be retried by the application/service as they are transient. Therefore, a very low threshold might cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD WriteThrottleEvents Dimensions: TableName, GlobalSecondaryIndexName Alarm description: This alarm detects if there are a high number of write requests getting throttled for Global Secondary Index of the DynamoDB table. See Troubleshooting throttling issues in Amazon DynamoDB to troubleshoot the issue. Intent: This alarm can detect sustained throttling for write requests for the Global Secondary Index of DynamoDB Table. Sustained throttling of write requests can negatively impact your workload write operations and reduce the overall efficiency of the system. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the expected Write traffic for the DynamoDB table, accounting for an acceptable level of throttling. It is important to monitor if you are under provisioned and not causing consistent throttling. You can also analyze historical data to find the acceptable throttling level for the application workload, and then tune the threshold to a value higher than your usual acceptable throttling level. Throttled requests should be retried by the application/service as they are transient. Therefore, a very low value might cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 369 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD Amazon EBS VolumeStalledIOCheck Dimensions: VolumeId, InstanceId Alarm description: This alarm helps you monitor the IO performance of your Amazon EBS volumes. This check detects underlying issues with the Amazon EBS infrastructure, such as hardware or software issues on the storage subsystems underlying the Amazon EBS volumes, hardware issues on the |
acw-ug-132 | acw-ug.pdf | 132 | throttling level. Throttled requests should be retried by the application/service as they are transient. Therefore, a very low value might cause the alarm to be too sensitive, causing unwanted state transitions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 369 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD Amazon EBS VolumeStalledIOCheck Dimensions: VolumeId, InstanceId Alarm description: This alarm helps you monitor the IO performance of your Amazon EBS volumes. This check detects underlying issues with the Amazon EBS infrastructure, such as hardware or software issues on the storage subsystems underlying the Amazon EBS volumes, hardware issues on the physical host that impact the reachability of the Amazon EBS volumes from your Amazon EC2 instance, and can detect connectivity issues between the instance and the Amazon EBS volumes. If the Stalled IO Check fails, you can either wait for AWS to resolve the issue, or you can take action such as replacing the affected volume or stopping and restarting the instance to which the volume is attached. In most cases, when this metric fails, Amazon EBS will automatically diagnose and recover your volume within a few minutes. Intent: This alarm can detect the status of your Amazon EBS volumes to determine when these volumes are impaired and can not complete I/O operations. Statistic: Maximum Recommended threshold: 1.0 Threshold justification: When a status check fails, the value of this metric is 1. The threshold is set so that whenever the status check fails, the alarm is in ALARM state. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Amazon EC2 CPUUtilization Dimensions: InstanceId Recommended alarms 370 Amazon CloudWatch User Guide Alarm description: This alarm helps to monitor the CPU utilization of an EC2 instance. Depending on the application, consistently high utilization levels might be normal. But if performance is degraded, and the application is not constrained by disk I/O, memory, or network resources, then a maxed-out CPU might indicate a resource bottleneck or application performance problems. High CPU utilization might indicate that an upgrade to a more CPU intensive instance is required. If detailed monitoring is enabled, you can change the period to 60 seconds instead of 300 seconds. For more information, see Enable or turn off detailed monitoring for your instances. Intent: This alarm is used to detect high CPU utilization. Statistic: Average Recommended threshold: 80.0 Threshold justification: Typically, you can set the threshold for CPU utilization to 70-80%. However, you can adjust this value based on your acceptable performance level and workload characteristics. For some systems, consistently high CPU utilization may be normal and not indicate a problem, while for others, it may be cause of concern. Analyze historical CPU utilization data to identify the usage, find what CPU utilization is acceptable for your system, and set the threshold accordingly. Period: 300 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: GREATER_THAN_THRESHOLD StatusCheckFailed Dimensions: InstanceId Alarm description: This alarm helps to monitor both system status checks and instance status checks. If either type of status check fails, then this alarm should be in ALARM state. Intent: This alarm is used to detect the underlying problems with instances, including both system status check failures and instance status check failures. Statistic: Maximum Recommended alarms 371 Amazon CloudWatch User Guide Recommended threshold: 1.0 Threshold justification: When a status check fails, the value of this metric is 1. The threshold is set so that whenever the status check fails, the alarm is in ALARM state. Period: 300 Datapoints to alarm: 2 Evaluation periods: 2 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD StatusCheckFailed_AttachedEBS Dimensions: InstanceId Alarm description: This alarm helps you monitor whether the Amazon EBS volumes attached to an instance are reachable and able to complete I/O operations. This status check detects underlying issues with the compute or Amazon EBS infrastructure such as the following: • Hardware or software issues on the storage subsystems underlying the Amazon EBS volumes • Hardware issues on the physical host that impact reachability of the Amazon EBS volumes • Connectivity issues between the instance and Amazon EBS volumes When the attached EBS status check fails, you can either wait for Amazon to resolve the issue, or you can take an action such as replacing the affected volumes or stopping and restarting the instance. Intent: This alarm is used to detect unreachable Amazon EBS volumes attached to an instance. These can cause failures in I/O operations. Statistic: Maximum Recommended threshold: 1.0 Threshold justification: When a status check fails, the value of this metric is 1. The threshold is set so that whenever the status check fails, the alarm is in ALARM state. Period: 60 Datapoints to alarm: 10 Recommended alarms 372 Amazon CloudWatch Evaluation periods: 10 User Guide Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Amazon ElastiCache CPUUtilization Dimensions: CacheClusterId, CacheNodeId Alarm description: This alarm helps to monitor the CPU utilization for |
acw-ug-133 | acw-ug.pdf | 133 | or stopping and restarting the instance. Intent: This alarm is used to detect unreachable Amazon EBS volumes attached to an instance. These can cause failures in I/O operations. Statistic: Maximum Recommended threshold: 1.0 Threshold justification: When a status check fails, the value of this metric is 1. The threshold is set so that whenever the status check fails, the alarm is in ALARM state. Period: 60 Datapoints to alarm: 10 Recommended alarms 372 Amazon CloudWatch Evaluation periods: 10 User Guide Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Amazon ElastiCache CPUUtilization Dimensions: CacheClusterId, CacheNodeId Alarm description: This alarm helps to monitor the CPU utilization for the entire ElastiCache instance, including the database engine processes and other processes running on the instance. AWS Elasticache supports two engine types: Memcached and Redis OSS. When you reach high CPU utilization on a Memcached node, you should consider scaling up your instance type or adding new cache nodes. For Redis OSS, if your main workload is from read requests, you should consider adding more read replicas to your cache cluster. If your main workload is from write requests, you should consider adding more shards to distribute the workload across more primary nodes if you’re running in clustered mode, or scaling up your instance type if you’re running Redis OSS in non-clustered mode. Intent: This alarm is used to detect high CPU utilization of ElastiCache hosts. It is useful to get a broad view of the CPU usage across the entire instance, including non-engine processes. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Set the threshold to the percentage that reflects a critical CPU utilization level for your application. For Memcached, the engine can use up to num_threads cores. For Redis OSS, the engine is largely single-threaded, but might use additional cores if available to accelerate I/O. In most cases, you can set the threshold to about 90% of your available CPU. Because Redis OSS is single-threaded, the actual threshold value should be calculated as a fraction of the node's total capacity. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 373 Amazon CloudWatch CurrConnections Dimensions: CacheClusterId, CacheNodeId User Guide Alarm description: This alarm detects high connection count, which might indicate heavy load or performance issues. A constant increase of CurrConnections might lead to exhaustion of the 65,000 available connections. It may indicate that connections improperly closed on the application side and were left established on the server side. You should consider using connection pooling or idle connection timeouts to limit the number of connections made to the cluster, or for Redis OSS, consider tuning tcp-keepalive on your cluster to detect and terminate potential dead peers. Intent: The alarm helps you identify high connection counts that could impact the performance and stability of your ElastiCache cluster. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the acceptable range of connections for your cluster. Review the capacity and the expected workload of your ElastiCache cluster and analyze the historical connection counts during regular usage to establish a baseline, and then select a threshold accordingly. Remember that each node can support up to 65,000 concurrent connections. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD DatabaseMemoryUsagePercentage Dimensions: CacheClusterId Alarm description: This alarm helps you monitor the memory utilization of your cluster. When your DatabaseMemoryUsagePercentage reaches 100%, the Redis OSS maxmemory policy is triggered and evictions might occur based on the policy selected. If no object in the cache matches the eviction policy, write operations fail. Some workloads expect or rely on evictions, Recommended alarms 374 Amazon CloudWatch User Guide but if not, you will need to increase the memory capacity of your cluster. You can scale your cluster out by adding more primary nodes, or scale it up by using a larger node type. Refer to Scaling ElastiCache for Redis OSS clusters for details. Intent: This alarm is used to detect high memory utilization of your cluster so that you can avoid failures when writing to your cluster. It is useful to know when you’ll need to scale up your cluster if your application does not expect to experience evictions. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Depending on your application’s memory requirements and the memory capacity of your ElastiCache cluster, you should set the threshold to the percentage that reflects the critical level of memory usage of the cluster. You can use historical memory usage data as reference for acceptable memory usage threshold. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD EngineCPUUtilization Dimensions: CacheClusterId Alarm description: This alarm helps to monitor the CPU utilization of a Redis OSS engine thread within the ElastiCache instance. Common reasons for high engine CPU are long-running |
acw-ug-134 | acw-ug.pdf | 134 | Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Depending on your application’s memory requirements and the memory capacity of your ElastiCache cluster, you should set the threshold to the percentage that reflects the critical level of memory usage of the cluster. You can use historical memory usage data as reference for acceptable memory usage threshold. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD EngineCPUUtilization Dimensions: CacheClusterId Alarm description: This alarm helps to monitor the CPU utilization of a Redis OSS engine thread within the ElastiCache instance. Common reasons for high engine CPU are long-running commands that consume high CPU, a high number of requests, an increase of new client connection requests in a short time period, and high evictions when the cache doesn’t have enough memory to hold new data. You should consider Scaling ElastiCache for Redis OSS clusters by adding more nodes or scaling up your instance type. Intent: This alarm is used to detect high CPU utilization of the Redis OSS engine thread. It is useful if you want to monitor the CPU usage of the database engine itself. Statistic: Average Recommended threshold: 90.0 Recommended alarms 375 Amazon CloudWatch User Guide Threshold justification: Set the threshold to a percentage that reflects the critical engine CPU utilization level for your application. You can benchmark your cluster using your application and expected workload to correlate EngineCPUUtilization and performance as a reference, and then set the threshold accordingly. In most cases, you can set the threshold to about 90% of your available CPU. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ReplicationLag Dimensions: CacheClusterId Alarm description: This alarm helps to monitor the replication health of your ElastiCache cluster. A high replication lag means that the primary node or the replica can’t keep up the pace of the replication. If your write activity is too high, consider scaling your cluster out by adding more primary nodes, or scaling it up by using a larger node type. Refer to Scaling ElastiCache for Redis OSS clusters for details. If your read replicas are overloaded by the amount of read requests, consider adding more read replicas. Intent: This alarm is used to detect a delay between data updates on the primary node and their synchronization to replica node. It helps to ensure data consistency of a read replica cluster node. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to your application's requirements and the potential impact of replication lag. You should consider your application's expected write rates and network conditions for the acceptable replication lag. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Recommended alarms 376 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD Amazon ECS The following are the recommended alarms for Amazon ECS. CPUReservation Dimensions: ClusterName Alarm description: This alarm helps you detect a high CPU reservation of the ECS cluster. High CPU reservation might indicate that the cluster is running out of registered CPUs for the task. To troubleshoot, you can add more capacity, you can scale the cluster, or you can set up auto scaling. Intent: The alarm is used to detect whether the total number of CPU units reserved by tasks on the cluster is reaching the total CPU units registered for the cluster. This helps you know when to scale up the cluster. Reaching the total CPU units for the cluster can result in running out of CPU for tasks. If you have EC2 capacity providers managed scaling turned on, or you have associated Fargate to capacity providers, then this alarm is not recommended. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold for CPU reservation to 80%. Alternatively, you can choose a lower value based on cluster characteristics. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD CPUUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect a high CPU utilization of the ECS service. If there is no ongoing ECS deployment, a maxed-out CPU utilization might indicate a resource Recommended alarms 377 Amazon CloudWatch User Guide bottleneck or application performance problems. To troubleshoot, you can increase the CPU limit. Intent: This alarm is used to detect high CPU utilization for the Amazon ECS service. Consistent high CPU utilization can indicate a resource bottleneck or application performance problems. Statistic: Average Recommended threshold: 80.0 Threshold justification: The service metrics for CPU utilization might exceed 100% utilization. However, we recommend that you monitor the metric for high CPU utilization to avoid impacting other services. Set the threshold to about 80-85%. We recommend that you update your task definitions to reflect actual usage to prevent future issues with other services. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD EBSFilesystemUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm |
acw-ug-135 | acw-ug.pdf | 135 | high CPU utilization for the Amazon ECS service. Consistent high CPU utilization can indicate a resource bottleneck or application performance problems. Statistic: Average Recommended threshold: 80.0 Threshold justification: The service metrics for CPU utilization might exceed 100% utilization. However, we recommend that you monitor the metric for high CPU utilization to avoid impacting other services. Set the threshold to about 80-85%. We recommend that you update your task definitions to reflect actual usage to prevent future issues with other services. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD EBSFilesystemUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect high storage utilization of the Amazon EBS volume attached to Amazon ECS tasks. If the utilization of the Amazon EBS volume is consistently high, you can check the usage and increase the volume size for new tasks. Intent: This alarm is used to detect high storage utilization of the Amazon EBS volumes attached to Amazon ECS tasks. Consistently high storage utilization can indicate that the Amazon EBS volume is full and it might lead to failure of the container. Statistic: Average Recommended threshold: 80.0 Threshold justification: You can set the threshold for Amazon EBS file system utilization to about 80%. You can adjust this value based on the acceptable storage utilization. For a read- only snapshot volume, a high utilization might indicate that the volume is right sized. For an Recommended alarms 378 Amazon CloudWatch User Guide active data volume, high storage utilization might indicate that the application is writing a large amount of data which may cause the container to fail if there is not enough capacity. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD MemoryReservation Dimensions: ClusterName Alarm description: This alarm helps you detect a high memory reservation of the Amazon ECS cluster. High memory reservation might indicate a resource bottleneck for the cluster. To troubleshoot, analyze the service task for performance to see if memory utilization of the task can be optimized. Also, you can register more memory or set up auto scaling. Intent: The alarm is used to detect whether the total memory units reserved by tasks on the cluster is reaching the total memory units registered for the cluster. This can help you know when to scale up the cluster. Reaching the total memory units for the cluster can cause the cluster to be unable to launch new tasks. If you have EC2 capacity providers managed scaling turned on or you have associated Fargate to capacity providers, this alarm is not recommended. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold for memory reservation to 80%. You can adjust this to a lower value based on cluster characteristics. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD MemoryUtilization Dimensions: ClusterName, ServiceName Recommended alarms 379 Amazon CloudWatch User Guide Alarm description: This alarm helps you detect a high memory utilization of the Amazon ECS service. If there is no ongoing Amazon ECS deployment, a maxed-out memory utilization might indicate a resource bottleneck or application performance problems. To troubleshoot, you can increase the memory limit. Intent: This alarm is used to detect high memory utilization for the Amazon ECS service. Consistent high memory utilization can indicate a resource bottleneck or application performance problems. Statistic: Average Recommended threshold: 80.0 Threshold justification: The service metrics for memory utilization might exceed 100% utilization. However, we recommend that you monitor the metric for high memory utilization to avoid impacting other services. Set the threshold to about 80%. We recommend that you update your task definitions to reflect actual usage to prevent future issues with other services. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD HTTPCode_Target_5XX_Count Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect a high server-side error count for the ECS service. This can indicate that there are errors that cause the server to be unable to serve requests. To troubleshoot, check your application logs. Intent: This alarm is used to detect a high server-side error count for the ECS service. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Calculate the value of about 5% of the your average traffic and use this value as a starting point for the threshold. You can find the average traffic by using the RequestCount metric. You can also analyze historical data to determine the acceptable error Recommended alarms 380 Amazon CloudWatch User Guide rate for the application workload, and then tune the threshold accordingly. Frequently occurring 5XX errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TargetResponseTime Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect a high |
acw-ug-136 | acw-ug.pdf | 136 | this value as a starting point for the threshold. You can find the average traffic by using the RequestCount metric. You can also analyze historical data to determine the acceptable error Recommended alarms 380 Amazon CloudWatch User Guide rate for the application workload, and then tune the threshold accordingly. Frequently occurring 5XX errors need to be alarmed on. However, setting a very low value for the threshold can cause the alarm to be too sensitive. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TargetResponseTime Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect a high target response time for ECS service requests. This can indicate that there are problems that cause the service to be unable to serve requests in time. To troubleshoot, check the CPUUtilization metric to see if the service is running out of CPU, or check the CPU utilization of other downstream services that your service depends on. Intent: This alarm is used to detect a high target response time for ECS service requests. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on your use case. Review the criticality and requirements of the target response time of the service and analyze the historical behavior of this metric to determine sensible threshold levels. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon ECS with Container Insights The following are the recommended alarms for Amazon ECS with Container Insights. Recommended alarms 381 Amazon CloudWatch EphemeralStorageUtilized Dimensions: ClusterName, ServiceName User Guide Alarm description: This alarm helps you detect high ephemeral storage utilized of the Fargate cluster. If ephemeral storage is consistently high, you can check ephemeral storage usage and increase the ephemeral storage. Intent: This alarm is used to detect high ephemeral storage usage for the Fargate cluster. Consistent high ephemeral storage utilized can indicate that the disk is full and it might lead to failure of the container. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Set the threshold to about 90% of the ephemeral storage size. You can adjust this value based on your acceptable ephemeral storage utilization of the Fargate cluster. For some systems, a consistently high ephemeral storage utilized might be normal, while for others, it might lead to failure of the container. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD RunningTaskCount Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect a low running task count of the Amazon ECS service. If the running task count is too low, it can can indicate that the application can’t handle the service load and it might lead to performance issues. If there is no running task, the Amazon ECS service might be unavailable or there might be deployment issues. Intent: This alarm is used to detect whether the number of running tasks are too low. A consistent low running task count can indicate Amazon ECS service deployment or performance issues. Statistic: Average Recommended alarms 382 Amazon CloudWatch User Guide Recommended threshold: 0.0 Threshold justification: You can adjust the threshold based on the minimum running task count of the Amazon ECS service. If the running task count is 0, the Amazon ECS service will be unavailable. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD TaskCpuUtilization Dimensions: ClusterName Alarm description: This alarm helps you detect high CPU utilization of tasks in your Amazon ECS cluster. If task CPU utilization is consistently high, you might need to optimize your tasks or increase their CPU reservation. Intent: This alarm is used to detect high CPU utilization for tasks in the Amazon ECS cluster. Consistent high CPU utilization can indicate that the tasks are under stress and might need more CPU resources or optimization to maintain performance. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the task's CPU reservation. You can adjust this value based on your acceptable CPU utilization for the tasks. For some workloads, consistently high CPU utilization might be normal, while for others, it might indicate performance issues or the need for more resources. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 383 Amazon CloudWatch TaskCpuUtilization Dimensions: ClusterName, ServiceName User Guide Alarm description: This alarm helps you detect high CPU utilization of tasks belonging to the Amazon ECS service. If task CPU utilization is consistently high, you might need to optimize your tasks or increase their CPU reservation. Intent: This alarm is used to detect high CPU utilization for tasks belonging to the Amazon ECS service. Consistent high CPU utilization can indicate that the tasks are under stress and might need more CPU resources or optimization to maintain performance. Statistic: Average Recommended threshold: 80.0 Threshold justification: |
acw-ug-137 | acw-ug.pdf | 137 | 5 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 383 Amazon CloudWatch TaskCpuUtilization Dimensions: ClusterName, ServiceName User Guide Alarm description: This alarm helps you detect high CPU utilization of tasks belonging to the Amazon ECS service. If task CPU utilization is consistently high, you might need to optimize your tasks or increase their CPU reservation. Intent: This alarm is used to detect high CPU utilization for tasks belonging to the Amazon ECS service. Consistent high CPU utilization can indicate that the tasks are under stress and might need more CPU resources or optimization to maintain performance. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the task's CPU reservation. You can adjust this value based on your acceptable CPU utilization for the tasks. For some workloads, consistently high CPU utilization might be normal, while for others, it might indicate performance issues or the need for more resources. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ContainerCpuUtilization Dimensions: ClusterName Alarm description: This alarm monitors the percentage of CPU units used by containers in your Amazon ECS cluster relative to their reserved CPU. It helps detect when containers are approaching their CPU limits based on the ContainerCpuUtilized/ContainerCpuReserved ratio. Intent: This alarm detects when containers in the Amazon ECS cluster are using a high percentage of their reserved CPU capacity, calculated as ContainerCpuUtilized/ ContainerCpuReserved. Sustained high values indicate containers are operating near their CPU limits and might need capacity adjustments. Statistic: Average Recommended alarms 384 Amazon CloudWatch User Guide Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the container's CPU utilization ratio. This provides an early warning when containers are approaching their CPU capacity limits while allowing for normal fluctuations in CPU usage. The threshold can be adjusted based on your workload characteristics and performance requirements. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ContainerCpuUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm monitors the percentage of CPU units used by containers belonging to the Amazon ECS service relative to their reserved CPU. It helps detect when containers are approaching their CPU limits based on the ContainerCpuUtilized/ ContainerCpuReserved ratio. Intent: This alarm detects when containers belonging to the Amazon ECS service are using a high percentage of their reserved CPU capacity, calculated as ContainerCpuUtilized/ ContainerCpuReserved. Sustained high values indicate containers are operating near their CPU limits and might need capacity adjustments. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the container's CPU utilization ratio. This provides an early warning when containers are approaching their CPU capacity limits while allowing for normal fluctuations in CPU usage. The threshold can be adjusted based on your workload characteristics and performance requirements. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 385 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD TaskEphemeralStorageUtilization Dimensions: ClusterName Alarm description: This alarm helps you detect high ephemeral storage utilization of tasks in your Amazon ECS cluster. If storage utilization is consistently high, you might need to optimize your storage usage or increase the storage reservation. Intent: This alarm is used to detect high ephemeral storage utilization for tasks in the Amazon ECS cluster. Consistent high storage utilization can indicate that the task is running out of disk space and might need more storage resources or optimization to maintain proper operation. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the task's ephemeral storage reservation. You can adjust this value based on your acceptable storage utilization for the tasks. For some workloads, consistently high storage utilization might be normal, while for others, it might indicate potential disk space issues or the need for more storage. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TaskEphemeralStorageUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect high ephemeral storage utilization of tasks belonging to the Amazon ECS service. If storage utilization is consistently high, you might need to optimize your storage usage or increase the storage reservation. Intent: This alarm is used to detect high ephemeral storage utilization for tasks belonging to the Amazon ECS service. Consistent high storage utilization can indicate that the task is running out of disk space and might need more storage resources or optimization to maintain proper operation. Recommended alarms 386 Amazon CloudWatch Statistic: Average Recommended threshold: 80.0 User Guide Threshold justification: Set the threshold to about 80% of the task's ephemeral storage reservation. You can adjust this value based on your acceptable storage utilization for the tasks. For some workloads, consistently high storage utilization might be normal, while for others, it might indicate potential disk space issues or the need for more storage. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TaskMemoryUtilization Dimensions: ClusterName Alarm description: |
acw-ug-138 | acw-ug.pdf | 138 | running out of disk space and might need more storage resources or optimization to maintain proper operation. Recommended alarms 386 Amazon CloudWatch Statistic: Average Recommended threshold: 80.0 User Guide Threshold justification: Set the threshold to about 80% of the task's ephemeral storage reservation. You can adjust this value based on your acceptable storage utilization for the tasks. For some workloads, consistently high storage utilization might be normal, while for others, it might indicate potential disk space issues or the need for more storage. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TaskMemoryUtilization Dimensions: ClusterName Alarm description: This alarm helps you detect high memory utilization of tasks in your Amazon ECS cluster. If memory utilization is consistently high, you might need to optimize your tasks or increase the memory reservation. Intent: This alarm is used to detect high memory utilization for tasks in the Amazon ECS cluster. Consistent high memory utilization can indicate that the task is under memory pressure and might need more memory resources or optimization to maintain stability. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the task's memory reservation. You can adjust this value based on your acceptable memory utilization for the tasks. For some workloads, consistently high memory utilization might be normal, while for others, it might indicate memory pressure or the need for more resources. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 387 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD TaskMemoryUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect high memory utilization of tasks belonging to the Amazon ECS service. If memory utilization is consistently high, you might need to optimize your tasks or increase the memory reservation. Intent: This alarm is used to detect high memory utilization for tasks belonging to the Amazon ECS service. Consistent high memory utilization can indicate that the task is under memory pressure and might need more memory resources or optimization to maintain stability. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the task's memory reservation. You can adjust this value based on your acceptable memory utilization for the tasks. For some workloads, consistently high memory utilization might be normal, while for others, it might indicate memory pressure or the need for more resources. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ContainerMemoryUtilization Dimensions: ClusterName Alarm description: This alarm helps you detect high memory utilization of containers in your Amazon ECS cluster. If memory utilization is consistently high, you might need to optimize your containers or increase the memory reservation. Intent: This alarm is used to detect high memory utilization for containers in the Amazon ECS cluster. Consistent high memory utilization can indicate that the container is under memory pressure and might need more memory resources or optimization to maintain stability. Recommended alarms 388 Amazon CloudWatch Statistic: Average Recommended threshold: 80.0 User Guide Threshold justification: Set the threshold to about 80% of the container's memory reservation. You can adjust this value based on your acceptable memory utilization for the containers. For some workloads, consistently high memory utilization might be normal, while for others, it might indicate memory pressure or the need for more resources. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ContainerMemoryUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect high memory utilization of containers belonging to the Amazon ECS service. If memory utilization is consistently high, you might need to optimize your containers or increase the memory reservation. Intent: This alarm is used to detect high memory utilization for containers belonging to the Amazon ECS service. Consistent high memory utilization can indicate that the container is under memory pressure and might need more memory resources or optimization to maintain stability. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the container's memory reservation. You can adjust this value based on your acceptable memory utilization for the containers. For some workloads, consistently high memory utilization might be normal, while for others, it might indicate memory pressure or the need for more resources. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 389 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD instance_filesystem_utilization Dimensions: InstanceId, ContainerInstanceId, ClusterName Alarm description: This alarm helps you detect a high file system utilization of the Amazon ECS cluster. If the file system utilization is consistently high, check the disk usage. Intent: This alarm is used to detect high file system utilization for the Amazon ECS cluster. A consistent high file system utilization can indicate a resource bottleneck or application performance problems, and it might prevent running new tasks. Statistic: Average Recommended threshold: 90.0 Threshold justification: You can set the threshold for file system utilization to about |
acw-ug-139 | acw-ug.pdf | 139 | Recommended alarms 389 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD instance_filesystem_utilization Dimensions: InstanceId, ContainerInstanceId, ClusterName Alarm description: This alarm helps you detect a high file system utilization of the Amazon ECS cluster. If the file system utilization is consistently high, check the disk usage. Intent: This alarm is used to detect high file system utilization for the Amazon ECS cluster. A consistent high file system utilization can indicate a resource bottleneck or application performance problems, and it might prevent running new tasks. Statistic: Average Recommended threshold: 90.0 Threshold justification: You can set the threshold for file system utilization to about 90-95%. You can adjust this value based on the acceptable file system capacity level of the Amazon ECS cluster. For some systems, a consistently high file system utilization might be normal and not indicate a problem, while for others, it might be a cause of concern and might lead to performance issues and prevent running new tasks. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon ECS with Container Insights with enhanced observability The following are the recommended alarms for Amazon ECS with Container Insights with enhanced observability. TaskCpuUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect the total percentage of CPU units being used by a task. Recommended alarms 390 Amazon CloudWatch User Guide Intent: This alarm is used to detect high task CPU utilization. Statistic: Average Recommended threshold: 80.0 Threshold justification: Typically, you can set the threshold for CPU utilization to 80%. However, you can adjust this value based on your acceptable performance level and workload characteristics. For some tasks, consistently high CPU utilization may be normal and not indicate a problem, while for others, it may be cause of concern. Analyze historical CPU utilization data to identify the usage, find what CPU utilization is acceptable for your tasks, and set the threshold accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TaskMemoryUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect the total percentage of memory being used by a task. Intent: This alarm is used to detect high memory utilization. Statistic: Average Recommended threshold: 80.0 Threshold justification: Typically, you can set the threshold for memory utilization to 80%. However, you can adjust this value based on your acceptable performance level and workload characteristics. For some tasks, consistently high memory utilization may be normal and not indicate a problem, while for others, it may be cause of concern. Analyze historical memory utilization data to identify the usage, find what memory utilization is acceptable for your tasks, and set the threshold accordingly. Period: 60 Recommended alarms 391 Amazon CloudWatch Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD ContainerCPUUtilization Dimensions: ContainerName, ClusterName, ServiceName User Guide Alarm description: This alarm helps you detect the total percentage of CPU units being used by a container. Intent: This alarm is used to detect high task CPU utilization. Statistic: Average Recommended threshold: 80.0 Threshold justification: Typically, you can set the threshold for CPU utilization to 80%. However, you can adjust this value based on your acceptable performance level and workload characteristics. For some containers, consistently high CPU utilization may be normal and not indicate a problem, while for others, it may be cause of concern. Analyze historical CPU utilization data to identify the usage, find what CPU utilization is acceptable for your containers, and set the threshold accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ContainerMemoryUtilization Dimensions: ContainerName, ClusterName, ServiceName Alarm description: This alarm helps you detect the total percentage of memory units being used by a container. Intent: This alarm is used to detect high task memory utilization. Statistic: Average Recommended alarms 392 Amazon CloudWatch User Guide Recommended threshold: 80.0 Threshold justification: Typically, you can set the threshold for memory utilization to 80%. However, you can adjust this value based on your acceptable performance level and workload characteristics. For some containers, consistently high memory utilization may be normal and not indicate a problem, while for others, it may be cause of concern. Analyze historical memory utilization data to identify the usage, find what memory utilization is acceptable for your tasks, and set the threshold accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD TaskEBSfilesystemUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect the total percentage of ephemeral storage being used by a task. . Intent: This alarm is used to detect high Amazon EBS file system usage for a task. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the Amazon EBS file system size. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TaskEphemeralStorageUtilization Dimensions: ClusterName, ServiceName Recommended alarms 393 Amazon CloudWatch User Guide Alarm description: This alarm helps |
acw-ug-140 | acw-ug.pdf | 140 | accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD TaskEBSfilesystemUtilization Dimensions: ClusterName, ServiceName Alarm description: This alarm helps you detect the total percentage of ephemeral storage being used by a task. . Intent: This alarm is used to detect high Amazon EBS file system usage for a task. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the Amazon EBS file system size. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD TaskEphemeralStorageUtilization Dimensions: ClusterName, ServiceName Recommended alarms 393 Amazon CloudWatch User Guide Alarm description: This alarm helps you detect the total percentage of ephemeral storage being used by a task. Intent: This alarm is used to detect high ephemeral storage usage for a task. Consistent high ephemeral storage utilized can indicate that the disk is full and it might lead to failure of the task. Statistic: Average Recommended threshold: 80.0 Threshold justification: Set the threshold to about 80% of the ephemeral storage size. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon EFS PercentIOLimit Dimensions: FileSystemId Alarm description: This alarm helps in ensuring that the workload stays within the I/O limit available to the file system. If the metric reaches its I/O limit consistently, consider moving the application to a file system that uses Max I/O performance as mode. For troubleshooting, check clients that are connected to the file system and applications of the clients that throttles the file system. Intent: This alarm is used to detect how close the file system is to reach the I/O limit of the General Purpose performance mode. Consistent high I/O percentage can be an indicator of the file system cannot scale with respect to I/O requests enough and the file system can be a resource bottleneck for the applications that use the file system. Statistic: Average Recommended threshold: 100.0 Recommended alarms 394 Amazon CloudWatch User Guide Threshold justification: When the file system reaches its I/O limit, it may respond to read and write requests slower. Therefore, it is recommended that the metric is monitored to avoid impacting applications that use the file system. The threshold can be set around 100%. However, this value can be adjusted to a lower value based on file system characteristics. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD BurstCreditBalance Dimensions: FileSystemId Alarm description: This alarm helps in ensuring that there is available burst credit balance for the file system usage. When there is no available burst credit, applications access to the the file system will be limited due to low throughput. If the metric drops to 0 consistently, consider changing the throughput mode to Elastic or Provisioned throughput mode. Intent: This alarm is used to detect low burst credit balance of the file system. Consistent low burst credit balance can be an indicator of the slowing down in throughput and increase in I/O latency. Statistic: Average Recommended threshold: 0.0 Threshold justification: When the file system run out of burst credits and even if the baseline throughput rate is lower, EFS continues to provide a metered throughput of 1 MiBps to all file systems. However, it is recommended that the metric is monitored for low burst credit balance to avoid the file system acting as resource bottleneck for the applications. The threshold can be set around 0 bytes. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD Recommended alarms 395 Amazon CloudWatch User Guide Amazon EKS with Container Insights node_cpu_utilization Dimensions: ClusterName Alarm description: This alarm helps to detect high CPU utilization in worker nodes of the EKS cluster. If the utilization is consistently high, it might indicate a need for replacing your worker nodes with instances that have greater CPU or a need to scale the system horizontally. Intent: This alarm helps to monitor the CPU utilization of the worker nodes in the EKS cluster so that the system performance doesn't degrade. Statistic: Maximum Recommended threshold: 80.0 Threshold justification: It is recommended to set the threshold at less than or equal to 80% to allow enough time to debug the issue before the system starts seeing impact. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD node_filesystem_utilization Dimensions: ClusterName Alarm description: This alarm helps to detect high file system utilization in the worker nodes of the EKS cluster. If the utilization is consistently high, you might need to update your worker nodes to have larger disk volume, or you might need to scale horizontally. Intent: This alarm helps to monitor the filesystem utilization of the worker nodes in the EKS cluster. If the utilization reaches 100%, it can lead to application failure, disk I/O bottlenecks, pod eviction, or the node to become unresponsive entirely. Statistic: Maximum Recommended threshold: Depends on your |
acw-ug-141 | acw-ug.pdf | 141 | periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD node_filesystem_utilization Dimensions: ClusterName Alarm description: This alarm helps to detect high file system utilization in the worker nodes of the EKS cluster. If the utilization is consistently high, you might need to update your worker nodes to have larger disk volume, or you might need to scale horizontally. Intent: This alarm helps to monitor the filesystem utilization of the worker nodes in the EKS cluster. If the utilization reaches 100%, it can lead to application failure, disk I/O bottlenecks, pod eviction, or the node to become unresponsive entirely. Statistic: Maximum Recommended threshold: Depends on your situation Recommended alarms 396 Amazon CloudWatch User Guide Threshold justification: If there's sufficient disk pressure (meaning that the disk is getting full), nodes are marked as not healthy, and the pods are evicted from the node. Pods on a node with disk pressure are evicted when the available file system is lower than the eviction thresholds set on the kubelet. Set the alarm threshold so that you have enough time to react before the node is evicted from the cluster. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD node_memory_utilization Dimensions: ClusterName Alarm description: This alarm helps in detecting high memory utilization in worker nodes of the EKS cluster. If the utilization is consistently high, it might indicate a need to scale the number of pod replicas, or optimize your application. Intent: This alarm helps to monitor the memory utilization of the worker nodes in the EKS cluster so that the system performance doesn't degrade. Statistic: Maximum Recommended threshold: 80.0 Threshold justification: It is recommended to set the threshold at less than or equal to 80% to allow having enough time to debug the issue before the system starts seeing impact. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD pod_cpu_utilization_over_pod_limit Dimensions: ClusterName, Namespace, Service Recommended alarms 397 Amazon CloudWatch User Guide Alarm description: This alarm helps in detecting high CPU utilization in pods of the EKS cluster. If the utilization is consistently high, it might indicate a need to increase the CPU limit for the affected pod. Intent: This alarm helps to monitor the CPU utilization of the pods belonging to a Kubernetes Service in the EKS cluster, so that you can quickly identify if a service's pod is consuming higher CPU than expected. Statistic: Maximum Recommended threshold: 80.0 Threshold justification: It is recommended to set the threshold at less than or equal to 80% to allow having enough time to debug the issue before the system starts seeing impact. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD pod_memory_utilization_over_pod_limit Dimensions: ClusterName, Namespace, Service Alarm description: This alarm helps in detecting high memory utilization in pods of the EKS cluster. If the utilization is consistently high, it might indicate a need to increase the memory limit for the affected pod. Intent: This alarm helps to monitor the memory utilization of the pods in the EKS cluster so that the system performance doesn't degrade. Statistic: Maximum Recommended threshold: 80.0 Threshold justification: It is recommended to set the threshold at less than or equal to 80% to allow having enough time to debug the issue before the system starts seeing impact. Period: 60 Recommended alarms 398 User Guide Amazon CloudWatch Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon EventBridge Scheduler TargetErrorThrottledCount Dimensions: None Alarm description: This alarm helps you identify target throttling. To avoid target throttling error, consider configuring flexible time windows to spread your invocation load or increasing limits with the target service. Intent: This alarm is used to detect target throttling errors, which can cause schedule delays. Statistic: Sum Recommended threshold: 0.0 Threshold justification: If the target throttling error is consistently greater than 0, schedule delivery is delayed. For some systems, target throttling errors for a brief period of time might be normal, while for others, it might be a cause of concern. Set this alarm's threshold, datapointsToAlarm, and evaluationPeriods accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD InvocationThrottleCount Dimensions: None Alarm description: This alarm helps you identify invocation throttling by Amazon EventBridge Scheduler. To avoid invocation throttling errors, consider configuring flexible time windows to spread your invocation load or increasing invocations throttle limit. Recommended alarms 399 Amazon CloudWatch User Guide Intent: This alarm is used to detect Amazon EventBridge Scheduler invocation throttling errors, which can cause schedule delays. Statistic: Sum Recommended threshold: 0.0 Threshold justification: If the invocation throttling is consistently greater than 0, schedule delivery is delayed. For some systems, invocation throttling errors for a brief period of time might be normal, while for others, it might be a cause of concern. Set this alarm's threshold, datapointsToAlarm, and evaluationPeriods accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison |
acw-ug-142 | acw-ug.pdf | 142 | time windows to spread your invocation load or increasing invocations throttle limit. Recommended alarms 399 Amazon CloudWatch User Guide Intent: This alarm is used to detect Amazon EventBridge Scheduler invocation throttling errors, which can cause schedule delays. Statistic: Sum Recommended threshold: 0.0 Threshold justification: If the invocation throttling is consistently greater than 0, schedule delivery is delayed. For some systems, invocation throttling errors for a brief period of time might be normal, while for others, it might be a cause of concern. Set this alarm's threshold, datapointsToAlarm, and evaluationPeriods accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD InvocationDroppedCount Dimensions: None Alarm description: This alarm helps you identify invocations dropped by Amazon EventBridge Scheduler. Consider investigating by configuring a DLQ for the schedule. Intent: This alarm is used to detect dropped invocations by Amazon EventBridge Scheduler. If you have configured a DLQ correctly on all of your schedules, dropped invocations will appear in the DLQ and you can skip setting up this alarm. Statistic: Sum Recommended threshold: 0.0 Threshold justification: Set the threshold to 0 to detect dropped invocations. Period: 60 Datapoints to alarm: 1 Evaluation periods: 1 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 400 Amazon CloudWatch User Guide InvocationsFailedToBeSentToDeadLetterCount Dimensions: None Alarm description: This alarm helps you identify invocations that were failed to be sent to the configured DLQ by Amazon EventBridge Scheduler. If the metric is consistently greater than 0, modify your DLQ configuration to resolve the issue. Use InvocationsFailedToBeSentToDeadLetterCount_metrics to determine the issue. Intent: This alarm is used to detect invocations failed to be sent to the configured DLQ by Amazon EventBridge Scheduler. Statistic: Sum Recommended threshold: 0.0 Threshold justification: Set the threshold to 0 to detect any invocations that were failed to be sent to the configured DLQ. Retryable errors also show up in this metric, so datapointsToAlarm for this alarm has been set to 15. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD Amazon Kinesis Data Streams GetRecords.IteratorAgeMilliseconds Dimensions: StreamName Alarm description: This alarm can detect if iterator maximum age is too high. For real-time data processing applications, configure data retention according to tolerance of the delay. This is usually within minutes. For applications that process historic data, use this metric to monitor catchup speed. A quick solution to stop data loss is to increase the retention period while you troubleshoot the issue. You can also increase the number of workers processing records in your consumer application. The most common causes for gradual iterator age increase are insufficient physical resources or record processing logic that has not scaled with an increase in stream throughput. See link for more details. Recommended alarms 401 Amazon CloudWatch User Guide Intent: This alarm is used to detect if data in your stream is going to expire because of being preserved too long or because record processing is too slow. It helps you avoid data loss after reaching 100% of the stream retention time. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the stream retention period and tolerance of processing delay for the records. Review your requirements and analyze historical trends, and then set the threshold to the number of milliseconds that represents a critical processing delay. If an iterator's age passes 50% of the retention period (by default, 24 hours, configurable up to 365 days), there is a risk for data loss because of record expiration. You can monitor the metric to make sure that none of your shards ever approach this limit. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD GetRecords.Success Dimensions: StreamName Alarm description: This metric increments whenever your consumers successfully read data from your stream. GetRecords doesn't return any data when it throws an exception. The most common exception is ProvisionedThroughputExceededException because request rate for the stream is too high, or because available throughput is already served for the given second. Reduce the frequency or size of your requests. For more information, see Streams Limits in the Amazon Kinesis Data Streams Developer Guide, and Error Retries and Exponential Backoff in AWS. Intent: This alarm can detect if the retrieval of records from the stream by consumers is failing. By setting an alarm on this metric, you can proactively detect any issues with data consumption, such as increased error rates or a decline in successful retrievals. This allows you to take timely actions to resolve potential problems and maintain a smooth data processing pipeline. Statistic: Average Recommended alarms 402 Amazon CloudWatch User Guide Recommended threshold: Depends on your situation Threshold justification: Depending on the importance of retrieving records from the stream, set the threshold based on your application’s tolerance for failed records. The threshold should be the corresponding percentage of successful operations. You |
acw-ug-143 | acw-ug.pdf | 143 | the stream by consumers is failing. By setting an alarm on this metric, you can proactively detect any issues with data consumption, such as increased error rates or a decline in successful retrievals. This allows you to take timely actions to resolve potential problems and maintain a smooth data processing pipeline. Statistic: Average Recommended alarms 402 Amazon CloudWatch User Guide Recommended threshold: Depends on your situation Threshold justification: Depending on the importance of retrieving records from the stream, set the threshold based on your application’s tolerance for failed records. The threshold should be the corresponding percentage of successful operations. You can use historical GetRecords metric data as reference for the acceptable failure rate. You should also consider retries when setting the threshold because failed records can be retried. This helps to prevent transient spikes from triggering unnecessary alerts. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD PutRecord.Success Dimensions: StreamName Alarm description: This alarm detects when the number of failed PutRecord operations breaches the threshold. Investigate the data producer logs to find the root causes of the failures. The most common reason is insufficient provisioned throughput on the shard that caused the ProvisionedThroughputExceededException. It happens because the request rate for the stream is too high, or the throughput attempted to be ingested into the shard is too high. Reduce the frequency or size of your requests. For more information, see Streams Limits and Error Retries and Exponential Backoff in AWS. Intent: This alarm can detect if ingestion of records into the stream is failing. It helps you identify issues in writing data to the stream. By setting an alarm on this metric, you can proactively detect any issues of producers in publishing data to the stream, such as increased error rates or a decrease in successful records being published. This enables you to take timely actions to address potential problems and maintain a reliable data ingestion process. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Depending on the importance of data ingestion and processing to your service, set the threshold based on your application’s tolerance for failed records. The threshold should be the corresponding percentage of successful operations. You can use Recommended alarms 403 Amazon CloudWatch User Guide historical PutRecord metric data as reference for the acceptable failure rate. You should also consider retries when setting the threshold because failed records can be retried. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD PutRecords.FailedRecords Dimensions: StreamName Alarm description: This alarm detects when the number of failed PutRecords exceeds the threshold. Kinesis Data Streams attempts to process all records in each PutRecords request, but a single record failure does not stop the processing of subsequent records. The main reason for these failures is exceeding the throughput of a stream or an individual shard. Common causes are traffic spikes and network latencies that cause records to arrive to the stream unevenly. You should detect unsuccessfully processed records and retry them in a subsequent call. Refer to Handling Failures When Using PutRecords for more details. Intent: This alarm can detect consistent failures when using batch operation to put records to your stream. By setting an alarm on this metric, you can proactively detect an increase in failed records, enabling you to take timely actions to address the underlying problems and ensure a smooth and reliable data ingestion process. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold to the number of failed records reflecting the tolerance of the the application for failed records. You can use historical data as reference for the acceptable failure value. You should also consider retries when setting the threshold because failed records can be retried in subsequent PutRecords calls. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 404 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD ReadProvisionedThroughputExceeded Dimensions: StreamName Alarm description: The alarm tracks the number of records that result in read throughput capacity throttling. If you find that you are being consistently throttled, you should consider adding more shards to your stream to increase your provisioned read throughput. If there is more than one consumer application running on the stream, and they share the GetRecords limit, we recommend that you register new consumer applications via Enhanced Fan-Out. If adding more shards does not lower the number of throttles, you may have a “hot” shard that is being read from more than other shards are. Enable enhanced monitoring, find the “hot” shard, and split it. Intent: This alarm can detect if consumers are throttled when they exceed your provisioned read throughput (determined by the number of shards you have). In that case, you won’t be able to read from the stream, and the stream can start backing up. Statistic: Average Recommended threshold: Depends on |
acw-ug-144 | acw-ug.pdf | 144 | the GetRecords limit, we recommend that you register new consumer applications via Enhanced Fan-Out. If adding more shards does not lower the number of throttles, you may have a “hot” shard that is being read from more than other shards are. Enable enhanced monitoring, find the “hot” shard, and split it. Intent: This alarm can detect if consumers are throttled when they exceed your provisioned read throughput (determined by the number of shards you have). In that case, you won’t be able to read from the stream, and the stream can start backing up. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Usually throttled requests can be retried and hence setting the threshold to zero makes the alarm too sensitive. However, consistent throttling can impact reading from the stream and should trigger the alarm. Set the threshold to a percentage according to the throttled requests for the application and retry configurations. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD SubscribeToShardEvent.MillisBehindLatest Dimensions: StreamName, ConsumerName Alarm description: This alarm detects when the delay of record processing in the application breaches the threshold. Transient problems such as API operation failures to a downstream Recommended alarms 405 Amazon CloudWatch User Guide application can cause a sudden increase in the metric. You should investigate if they consistently happen. A common cause is the consumer is not processing records fast enough because of insufficient physical resources or record processing logic that has not scaled with an increase in stream throughput. Blocking calls in critical path is often the cause of slowdowns in record processing. You can increase your parallelism by increasing the number of shards. You should also confirm underlying processing nodes have sufficient physical resources during peak demand. Intent: This alarm can detect delay in the subscription to shard event of the stream. This indicates a processing lag and can help identify potential issues with the consumer application's performance or the overall stream's health. When the processing lag becomes significant, you should investigate and address any bottlenecks or consumer application inefficiencies to ensure real-time data processing and minimize data backlog. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the delay that your application can tolerate. Review your application's requirements and analyze historical trends, and then select a threshold accordingly. When the SubscribeToShard call succeeds, your consumer starts receiving SubscribeToShardEvent events over the persistent connection for up to 5 minutes, after which time you need to call SubscribeToShard again to renew the subscription if you want to continue to receive records. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD WriteProvisionedThroughputExceeded Dimensions: StreamName Alarm description: This alarm detects when the number of records resulting in write throughput capacity throttling reached the threshold. When your producers exceed your provisioned write throughput (determined by the number of shards you have), they are throttled and you won’t be able to put records to the stream. To address consistent throttling, Recommended alarms 406 Amazon CloudWatch User Guide you should consider adding shards to your stream. This raises your provisioned write throughput and prevents future throttling. You should also consider partition key choice when ingesting records. Random partition key is preferred because it spreads records evenly across the shards of the stream, whenever possible. Intent: This alarm can detect if your producers are being rejected for writing records because of throttling of the stream or shard. If your stream is in Provisioned mode, then setting this alarm helps you proactively take actions when the data stream reaches its limits, allowing you to optimize the provisioned capacity or take appropriate scaling actions to avoid data loss and maintain smooth data processing. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Usually throttled requests can be retried, so setting the threshold to zero makes the alarm too sensitive. However, consistent throttling can impact writing to the stream, and you should set the alarm threshold to detect this. Set the threshold to a percentage according to the throttled requests for the application and retry configurations. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Lambda ClaimedAccountConcurrency Dimensions: None Alarm description: This alarm helps to monitor if the concurrency of your Lambda functions is approaching the Region-level concurrency limit of your account. A function starts to be throttled if it reaches the concurrency limit. You can take the following actions to avoid throttling. 1. Request a concurrency increase in this Region. 2. Identify and reduce any unused reserved concurrency or provisioned concurrency. Recommended alarms 407 Amazon CloudWatch User Guide 3. Identify performance issues in the functions to improve the speed of processing and therefore improve throughput. 4. Increase the batch size of the functions, so that more messages are |
acw-ug-145 | acw-ug.pdf | 145 | Alarm description: This alarm helps to monitor if the concurrency of your Lambda functions is approaching the Region-level concurrency limit of your account. A function starts to be throttled if it reaches the concurrency limit. You can take the following actions to avoid throttling. 1. Request a concurrency increase in this Region. 2. Identify and reduce any unused reserved concurrency or provisioned concurrency. Recommended alarms 407 Amazon CloudWatch User Guide 3. Identify performance issues in the functions to improve the speed of processing and therefore improve throughput. 4. Increase the batch size of the functions, so that more messages are processed by each function invocation. Intent: This alarm can proactively detect if the concurrency of your Lambda functions is approaching the Region-level concurrency quota of your account, so that you can act on it. Functions are throttled if ClaimedAccountConcurrency reaches the Region-level concurrency quota of the account. If you are using Reserved Concurrency (RC) or Provisioned Concurrency (PC), this alarm gives you more visibility on concurrency utilization than an alarm on ConcurrentExecutions would. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: You should calculate the value of about 90% of the concurrency quota set for the account in the Region, and use the result as the threshold value. By default, your account has a concurrency quota of 1,000 across all functions in a Region. However, you should check the quota of your account from the Service Quotas dashboard. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD Errors Dimensions: FunctionName Alarm description: This alarm detects high error counts. Errors includes the exceptions thrown by the code as well as exceptions thrown by the Lambda runtime. You can check the logs related to the function to diagnose the issue. Intent: The alarm helps detect high error counts in function invocations. Statistic: Sum Recommended threshold: Depends on your situation Recommended alarms 408 Amazon CloudWatch User Guide Threshold justification: Set the threshold to a number greater than zero. The exact value can depend on the tolerance for errors in your application. Understand the criticality of the invocations that the function is handling. For some applications, any error might be unacceptable, while other applications might allow for a certain margin of error. Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: GREATER_THAN_THRESHOLD Throttles Dimensions: FunctionName Alarm description: This alarm detects a high number of throttled invocation requests. Throttling occurs when there is no concurrency is available for scale up. There are several approaches to resolve this issue. 1) Request a concurrency increase from AWS Support in this Region. 2) Identify performance issues in the function to improve the speed of processing and therefore improve throughput. 3) Increase the batch size of the function, so that more messages are processed by each function invocation. Intent: The alarm helps detect a high number of throttled invocation requests for a Lambda function. It is important to know if requests are constantly getting rejected due to throttling and if you need to improve Lambda function performance or increase concurrency capacity to avoid constant throttling. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold to a number greater than zero. The exact value of the threshold can depend on the tolerance of the application. Set the threshold according to its usage and scaling requirements of the function. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 409 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD Duration Dimensions: FunctionName Alarm description: This alarm detects long duration times for processing an event by a Lambda function. Long durations might be because of changes in function code making the function take longer to execute, or the function's dependencies taking longer. Intent: This alarm can detect a long running duration of a Lambda function. High runtime duration indicates that a function is taking a longer time for invocation, and can also impact the concurrency capacity of invocation if Lambda is handling a higher number of events. It is critical to know if the Lambda function is constantly taking longer execution time than expected. Statistic: p90 Recommended threshold: Depends on your situation Threshold justification: The threshold for the duration depends on your application and workloads and your performance requirements. For high-performance requirements, set the threshold to a shorter time to see if the function is meeting expectations. You can also analyze historical data for duration metrics to see the if the time taken matches the performance expectation of the function, and then set the threshold to a longer time than the historical average. Make sure to set the threshold lower than the configured function timeout. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD ConcurrentExecutions Dimensions: FunctionName Alarm description: This alarm helps to monitor if the concurrency of the |
acw-ug-146 | acw-ug.pdf | 146 | application and workloads and your performance requirements. For high-performance requirements, set the threshold to a shorter time to see if the function is meeting expectations. You can also analyze historical data for duration metrics to see the if the time taken matches the performance expectation of the function, and then set the threshold to a longer time than the historical average. Make sure to set the threshold lower than the configured function timeout. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD ConcurrentExecutions Dimensions: FunctionName Alarm description: This alarm helps to monitor if the concurrency of the function is approaching the Region-level concurrency limit of your account. A function starts to be throttled if it reaches the concurrency limit. You can take the following actions to avoid throttling. 1. Request a concurrency increase in this Region. Recommended alarms 410 Amazon CloudWatch User Guide 2. Identify performance issues in the functions to improve the speed of processing and therefore improve throughput. 3. Increase the batch size of the functions, so that more messages are processed by each function invocation. To get better visibility on reserved concurrency and provisioned concurrency utilization, set an alarm on the new metric ClaimedAccountConcurrency instead. Intent: This alarm can proactively detect if the concurrency of the function is approaching the Region-level concurrency quota of your account, so that you can act on it. A function is throttled if it reaches the Region-level concurrency quota of the account. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: Set the threshold to about 90% of the concurrency quota set for the account in the Region. By default, your account has a concurrency quota of 1,000 across all functions in a Region. However, you can check the quota of your account, as it can be increased by contacting AWS support. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD Lambda Insights We recommend setting best-practice alarms for the following Lambda Insights metrics. memory_utilization Dimensions: function_name Alarm description: This alarm is used to detect if the memory utilization of a lambda function is approaching the configured limit. For troubleshooting, you can try to 1) Optimize your code. 2) Rightly size your memory allocation by accurately estimating the memory requirements. You can refer to Lambda Power Tuning for the same. 3) Use connection pooling. Refer to Using Recommended alarms 411 Amazon CloudWatch User Guide Amazon RDS Proxy with Lambda for the connection pooling for RDS database. 4) You can also consider designing your functions to avoid storing large amounts of data in memory between invocations. Intent: This alarm is used to detect if the memory utilization for the Lambda function is approaching the configured limit. Statistic: Average Threshold Suggestion: 90.0 Threshold Justification: Set the threshold to 90% to get an alert when memory utilization exceeds 90% of the allocated memory. You can adjust this to a lower value if you have a concern for the workload for memory utilization. You can also check the historical data for this metric and set the threshold accordingly. Period: 60 Datapoints to alarm: 10 Evaluation Periods: 10 ComparisonOperator: GREATER_THAN_THRESHOLD Amazon VPC (AWS/NATGateway) ErrorPortAllocation Dimensions: NatGatewayId Alarm description: This alarm helps to detect when the NAT Gateway is unable to allocate ports to new connections. To resolve this issue, see Resolve port allocation errors on NAT Gateway. Intent: This alarm is used to detect if the NAT gateway could not allocate a source port. Statistic: Sum Recommended threshold: 0.0 Threshold justification: If the value of ErrorPortAllocation is greater than zero, that means too many concurrent connections to a single popular destination are open through NATGateway. Recommended alarms 412 Amazon CloudWatch Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD PacketsDropCount Dimensions: NatGatewayId User Guide Alarm description: This alarm helps to detect when packets are dropped by NAT Gateway. This might happen because of an issue with NAT Gateway, so check AWS service health dashboard for the status of AWS NAT Gateway in your Region. This can help you correlate the network issue related to traffic using NAT gateway. Intent: This alarm is used to detect if packets are being dropped by NAT Gateway. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: You should calculate the value of 0.01 percent of the total traffic on the NAT Gateway and use that result as the threshold value. Use historical data of the traffic on NAT Gateway to determine the threshold. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD AWS Private Link (AWS/PrivateLinkEndpoints) PacketsDropped Dimensions: VPC Id, VPC Endpoint Id, Endpoint Type, Subnet Id, Service Name Alarm description: This alarm helps to detect if the endpoint or endpoint service is unhealthy by monitoring the number of packets dropped by the endpoint. Note that packets |
acw-ug-147 | acw-ug.pdf | 147 | Depends on your situation Threshold justification: You should calculate the value of 0.01 percent of the total traffic on the NAT Gateway and use that result as the threshold value. Use historical data of the traffic on NAT Gateway to determine the threshold. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD AWS Private Link (AWS/PrivateLinkEndpoints) PacketsDropped Dimensions: VPC Id, VPC Endpoint Id, Endpoint Type, Subnet Id, Service Name Alarm description: This alarm helps to detect if the endpoint or endpoint service is unhealthy by monitoring the number of packets dropped by the endpoint. Note that packets larger than Recommended alarms 413 Amazon CloudWatch User Guide 8500 bytes that arrive at the VPC endpoint are dropped. For troubleshooting, see connectivity problems between an interface VPC endpoint and an endpoint service. Intent: This alarm is used to detect if the endpoint or endpoint service is unhealthy. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: Set the threshold according to the use case. If you want to be aware of the unhealthy status of the endpoint or endpoint service, you should set the threshold low so that you get a chance to fix the issue before a huge data loss. You can use historical data to understand the tolerance for dropped packets and set the threshold accordingly. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD AWS Private Link (AWS/PrivateLinkServices) RstPacketsSent Dimensions: Service Id, Load Balancer Arn, Az Alarm description: This alarm helps you detect unhealthy targets of an endpoint service based on the number of reset packets that are sent to endpoints. When you debug connection errors with a consumer of your service, you can validate whether the service is resetting connections with the RstPacketsSent metric, or if something else is failing on the network path. Intent: This alarm is used to detect unhealthy targets of an endpoint service. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: The threshold depends on the use case. If your use case can tolerate targets being unhealthy, you can set the threshold high. If the use case can’t tolerate unhealthy targets you can set the threshold very low. Recommended alarms 414 User Guide Amazon CloudWatch Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon RDS CPUUtilization Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor consistent high CPU utilization. CPU utilization measures non-idle time. Consider using Enhanced Monitoring or Performance Insights to review which wait time is consuming the most of the CPU time (guest, irq, wait, nice, and so on) for MariaDB, MySQL, Oracle, and PostgreSQL. Then evaluate which queries consume the highest amount of CPU. If you can't tune your workload, consider moving to a larger DB instance class. Intent: This alarm is used to detect consistent high CPU utilization in order to prevent very high response time and time-outs. If you want to check micro-bursting of CPU utilization you can set a lower alarm evaluation time. Statistic: Average Recommended threshold: 90.0 Threshold justification: Random spikes in CPU consumption might not hamper database performance, but sustained high CPU can hinder upcoming database requests. Depending on the overall database workload, high CPU at your RDS/Aurora instance can degrade the overall performance. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 415 Amazon CloudWatch DatabaseConnections Dimensions: DBInstanceIdentifier User Guide Alarm description: This alarm detects a high number of connections. Review existing connections and terminate any that are in `sleep` state or that are improperly closed. Consider using connection pooling to limit the number of new connections. Alternatively, increase the DB instance size to use a class with more memory and hence a higher default value for `max_connections` or increase the `max_connections` value in RDS and Aurora MySQL and PostgreSQL for the current class if it can support your workload. Intent: This alarm is used to help prevent rejected connections when the maximum number of DB connections is reached. This alarm is not recommended if you frequently change DB instance class, because doing so changes the memory and default maximum number of connections. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The number of connections allowed depends on the size of your DB instance class and database engine-specific parameters related to processes/connections. You should calculate a value between 90-95% of the maximum number of connections for your database and use that result as the threshold value. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD EBSByteBalance% Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor a low percentage of throughput credits remaining. For troubleshooting, check latency problems in RDS. Intent: This alarm is used to detect a low percentage of throughput credits remaining in the burst bucket. Low byte balance percentage can |
acw-ug-148 | acw-ug.pdf | 148 | allowed depends on the size of your DB instance class and database engine-specific parameters related to processes/connections. You should calculate a value between 90-95% of the maximum number of connections for your database and use that result as the threshold value. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD EBSByteBalance% Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor a low percentage of throughput credits remaining. For troubleshooting, check latency problems in RDS. Intent: This alarm is used to detect a low percentage of throughput credits remaining in the burst bucket. Low byte balance percentage can cause throughput bottleneck issues. This alarm is not recommended for Aurora PostgreSQL instances. Recommended alarms 416 Amazon CloudWatch Statistic: Average Recommended threshold: 10.0 User Guide Threshold justification: A throughput credit balance below 10% is considered to be poor and you should set the threshold accordingly. You can also set a lower threshold if your application can tolerate a lower throughput for the workload. Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: LESS_THAN_THRESHOLD EBSIOBalance% Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor low percentage of IOPS credits remaining. For troubleshooting, see latency problems in RDS. Intent: This alarm is used to detect a low percentage of I/O credits remaining in the burst bucket. Low IOPS balance percentage can cause IOPS bottleneck issues. This alarm is not recommended for Aurora instances. Statistic: Average Recommended threshold: 10.0 Threshold justification: An IOPS credits balance below 10% is considered to be poor and you can set the threshold accordingly. You can also set a lower threshold, if your application can tolerate a lower IOPS for the workload. Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: LESS_THAN_THRESHOLD Recommended alarms 417 Amazon CloudWatch FreeableMemory Dimensions: DBInstanceIdentifier User Guide Alarm description: This alarm helps to monitor low freeable memory which can mean that there is a spike in database connections or that your instance may be under high memory pressure. Check for memory pressure by monitoring the CloudWatch metrics for SwapUsage`in addition to FreeableMemory. If the instance memory consumption is frequently too high, this indicates that you should check your workload or upgrade your instance class. For Aurora reader DB instance, consider adding additional reader DB instances to the cluster. For information about troubleshooting Aurora, see freeable memory issues. Intent: This alarm is used to help prevent running out of memory which can result in rejected connections. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Depending on the workload and instance class, different values for the threshold can be appropriate. Ideally, available memory should not go below 25% of total memory for prolonged periods. For Aurora, you can set the threshold close to 5%, because the metric approaching 0 means that the DB instance has scaled up as much as it can. You can analyze the historical behavior of this metric to determine sensible threshold levels. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: LESS_THAN_THRESHOLD FreeLocalStorage Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor low free local storage. Aurora PostgreSQL- Compatible Edition uses local storage for storing error logs and temporary files. Aurora MySQL uses local storage for storing error logs, general logs, slow query logs, audit logs, and non- InnoDB temporary tables. These local storage volumes are backed by Amazon EBS Store Recommended alarms 418 Amazon CloudWatch User Guide and can be extended by using a larger DB instance class. For troubleshooting, check Aurora PostgreSQL-Compatible and MySQL-Compatible. Intent: This alarm is used to detect how close the Aurora DB instance is to reaching the local storage limit, if you do not use Aurora Serverless v2 or higher. Local storage can reach capacity when you store non-persistent data, such as temporary table and log files, in the local storage. This alarm can prevent an out-of-space error that occurs when your DB instance runs out of local storage. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: You should calculate about 10%-20% of the amount of storage available based on velocity and trend of volume usage, and then use that result as the threshold value to proactively take action before the volume reaches its limit. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD FreeStorageSpace Dimensions: DBInstanceIdentifier Alarm description: This alarm watches for a low amount of available storage space. Consider scaling up your database storage if you frequently approach storage capacity limits. Include some buffer to accommodate unforeseen increases in demand from your applications. Alternatively, consider enabling RDS storage auto scaling. Additionally, consider freeing up more space by deleting unused or outdated data and logs. For further information, check RDS run out of storage document and PostgreSQL storage issues document. Intent: This alarm helps prevent storage full issues. This can prevent |
acw-ug-149 | acw-ug.pdf | 149 | Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD FreeStorageSpace Dimensions: DBInstanceIdentifier Alarm description: This alarm watches for a low amount of available storage space. Consider scaling up your database storage if you frequently approach storage capacity limits. Include some buffer to accommodate unforeseen increases in demand from your applications. Alternatively, consider enabling RDS storage auto scaling. Additionally, consider freeing up more space by deleting unused or outdated data and logs. For further information, check RDS run out of storage document and PostgreSQL storage issues document. Intent: This alarm helps prevent storage full issues. This can prevent downtime that occurs when your database instance runs out of storage. We do not recommend using this alarm if you have storage auto scaling enabled, or if you frequently change the storage capacity of the database instance. Statistic: Minimum Recommended alarms 419 Amazon CloudWatch User Guide Recommended threshold: Depends on your situation Threshold justification: The threshold value will depend on the currently allocated storage space. Typically, you should calculate the value of 10 percent of the allocated storage space and use that result as the threshold value. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD MaximumUsedTransactionIDs Dimensions: DBInstanceIdentifier Alarm description: This alarm helps prevent transaction ID wraparound for PostgreSQL. Refer to the troubleshooting steps in this blog to investigate and resolve the issue. You can also refer to this blog to familiarize yourself further with autovacuum concepts, common issues and best practices. Intent: This alarm is used to help prevent transaction ID wraparound for PostgreSQL. Statistic: Average Recommended threshold: 1.0E9 Threshold justification: Setting this threshold to 1 billion should give you time to investigate the problem. The default autovacuum_freeze_max_age value is 200 million. If the age of the oldest transaction is 1 billion, autovacuum is having a problem keeping this threshold below the target of 200 million transaction IDs. Period: 60 Datapoints to alarm: 1 Evaluation periods: 1 Comparison Operator: GREATER_THAN_THRESHOLD ReadLatency Dimensions: DBInstanceIdentifier Recommended alarms 420 Amazon CloudWatch User Guide Alarm description: This alarm helps to monitor high read latency. If storage latency is high, it's because the workload is exceeding resource limits. You can review I/O utilization relative to instance and allocated storage configuration. Refer to troubleshoot the latency of Amazon EBS volumes caused by an IOPS bottleneck. For Aurora, you can switch to an instance class that has I/O-Optimized storage configuration. See Planning I/O in Aurora for guidance. Intent: This alarm is used to detect high read latency. Database disks normally have a low read/ write latency, but they can have issues that can cause high latency operations. Statistic: p90 Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on your use case. Read latencies higher than 20 milliseconds are likely a cause for investigation. You can also set a higher threshold if your application can have higher latency for read operations. Review the criticality and requirements of read latency and analyze the historical behavior of this metric to determine sensible threshold levels. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD ReplicaLag Dimensions: DBInstanceIdentifier Alarm description: This alarm helps you understand the number of seconds a replica is behind the primary instance. A PostgreSQL Read Replica reports a replication lag of up to five minutes if there are no user transactions occurring on the source database instance. When the ReplicaLag metric reaches 0, the replica has caught up to the primary DB instance. If the ReplicaLag metric returns -1, then replication is currently not active. For guidance related to RDS PostgreSQL, see replication best practices and for troubleshooting ReplicaLag and related errors, see troubleshooting ReplicaLag. Intent: This alarm can detect the replica lag which reflects the data loss that could happen in case of a failure of the primary instance. If the replica gets too far behind the primary and the primary fails, the replica will be missing data that was in the primary instance. Recommended alarms 421 Amazon CloudWatch Statistic: Maximum Recommended threshold: 60.0 User Guide Threshold justification: Typically, the acceptable lag depends on the application. We recommend no more than 60 seconds. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD WriteLatency Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor high write latency. If storage latency is high, it's because the workload is exceeding resource limits. You can review I/O utilization relative to instance and allocated storage configuration. Refer to troubleshoot the latency of Amazon EBS volumes caused by an IOPS bottleneck. For Aurora, you can switch to an instance class that has I/O-Optimized storage configuration. See Planning I/O in Aurora for guidance. Intent: This alarm is used to detect high write latency. Although database disks typically have low read/write latency, they may experience |
acw-ug-150 | acw-ug.pdf | 150 | Evaluation periods: 10 Comparison Operator: GREATER_THAN_THRESHOLD WriteLatency Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor high write latency. If storage latency is high, it's because the workload is exceeding resource limits. You can review I/O utilization relative to instance and allocated storage configuration. Refer to troubleshoot the latency of Amazon EBS volumes caused by an IOPS bottleneck. For Aurora, you can switch to an instance class that has I/O-Optimized storage configuration. See Planning I/O in Aurora for guidance. Intent: This alarm is used to detect high write latency. Although database disks typically have low read/write latency, they may experience problems that cause high latency operations. Monitoring this will assure you the disk latency is as low as expected. Statistic: p90 Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on your use case. Write latencies higher than 20 milliseconds are likely a cause for investigation. You can also set a higher threshold if your application can have a higher latency for write operations. Review the criticality and requirements of write latency and analyze the historical behavior of this metric to determine sensible threshold levels. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 422 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD DBLoad Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor high DB load. If the number of processes exceed the number of vCPUs, the processes start queuing. When the queuing increases, the performance is impacted. If the DB load is often above the maximum vCPU, and the primary wait state is CPU, the CPU is overloaded. In this case, you can monitor CPUUtilization, DBLoadCPU and queued tasks in Performance Insights/Enhanced Monitoring. You might want to throttle connections to the instance, tune any SQL queries with a high CPU load, or consider a larger instance class. High and consistent instances of any wait state indicate that there might be bottlenecks or resource contention issues to resolve. Intent: This alarm is used to detect a high DB load. High DB load can cause performance issues in the DB instance. This alarm is not applicable to serverless DB instances. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The maximum vCPU value is determined by the number of vCPU (virtual CPU) cores for your DB instance. Depending on the maximum vCPU, different values for the threshold can be appropriate. Ideally, DB load should not go above vCPU line. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD AuroraVolumeBytesLeftTotal Dimensions: DBClusterIdentifier Alarm description: This alarm helps to monitor low remaining total volume. When the total volume left reaches the size limit, the cluster reports an out-of-space error. Aurora storage automatically scales with the data in the cluster volume and expands up to 128 TiB or 64 TiB depending on the DB engine version. Consider reducing storage by dropping tables and databases that you no longer need. For more information, check storage scaling. Recommended alarms 423 Amazon CloudWatch User Guide Intent: This alarm is used to detect how close the Aurora cluster is to the volume size limit. This alarm can prevent an out-of-space error that occurs when your cluster runs out of space. This alarm is recommended only for Aurora MySQL. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: You should calculate 10%-20% of the actual size limit based on velocity and trend of volume usage increase, and then use that result as the threshold value to proactively take action before the volume reaches its limit. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD AuroraBinlogReplicaLag Dimensions: DBClusterIdentifier, Role=WRITER Alarm description: This alarm helps to monitor the error state of Aurora writer instance replication. For more information, see Replicating Aurora MySQL DB clusters across AWS Regions. For troubleshooting, see Aurora MySQL replication issues. Intent: This alarm is used to detect whether the writer instance is in an error state and can’t replicate the source. This alarm is recommended only for Aurora MySQL. Statistic: Average Recommended threshold: -1.0 Threshold justification: We recommend that you use -1 as the threshold value because Aurora MySQL publishes this value if the replica is in an error state. Period: 60 Datapoints to alarm: 2 Evaluation periods: 2 Recommended alarms 424 Amazon CloudWatch User Guide Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD BlockedTransactions Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor a high blocked transaction count in an Aurora DB instance. Blocked transactions can end in either a rollback or a commit. High concurrency, idles in transaction, or long running transactions can lead to blocked transactions. For troubleshooting, see Aurora MySQL documentation. Intent: This alarm is used to detect a high count of blocked transactions in an Aurora DB instance in order to prevent transaction rollbacks and performance degradation. Statistic: Average |
acw-ug-151 | acw-ug.pdf | 151 | state. Period: 60 Datapoints to alarm: 2 Evaluation periods: 2 Recommended alarms 424 Amazon CloudWatch User Guide Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD BlockedTransactions Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor a high blocked transaction count in an Aurora DB instance. Blocked transactions can end in either a rollback or a commit. High concurrency, idles in transaction, or long running transactions can lead to blocked transactions. For troubleshooting, see Aurora MySQL documentation. Intent: This alarm is used to detect a high count of blocked transactions in an Aurora DB instance in order to prevent transaction rollbacks and performance degradation. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: You should calculate 5% of all transactions of your instance using the ActiveTransactions metric and use that result as the threshold value. You can also review the criticality and requirements of blocked transactions and analyze the historical behavior of this metric to determine sensible threshold levels. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD BufferCacheHitRatio Dimensions: DBInstanceIdentifier Alarm description: This alarm helps you monitor a consistent low cache hit ratio of the Aurora cluster. A low hit ratio indicates that your queries on this DB instance are frequently going to disk. For troubleshooting, investigate your workload to see which queries are causing this behavior, and see the DB instance RAM recommendations document. Intent: This alarm is used to detect consistent low cache hit ratio in order to prevent a sustained performance decrease in the Aurora instance. Statistic: Average Recommended alarms 425 Amazon CloudWatch User Guide Recommended threshold: 80.0 Threshold justification: You can set the threshold for buffer cache hit ratio to 80%. However, you can adjust this value based on your acceptable performance level and workload characteristics. Period: 60 Datapoints to alarm: 10 Evaluation periods: 10 Comparison Operator: LESS_THAN_THRESHOLD EngineUptime Dimensions: DBClusterIdentifier, Role=WRITER Alarm description: This alarm helps to monitor low downtime of the writer DB instance. The writer DB instance can go down due to a reboot, maintenance, upgrade, or failover. When the uptime reaches 0 because of a failover in the cluster, and the cluster has one or more Aurora Replicas, then an Aurora Replica is promoted to the primary writer instance during a failure event. To increase the availability of your DB cluster, consider creating one or more Aurora Replicas in two or more different Availability Zones. For more information check factors that influence Aurora downtime. Intent: This alarm is used to detect whether the Aurora writer DB instance is in downtime. This can prevent long-running failure in the writer instance that occurs because of a crash or failover. Statistic: Average Recommended threshold: 0.0 Threshold justification: A failure event results in a brief interruption, during which read and write operations fail with an exception. However, service is typically restored in less than 60 seconds, and often less than 30 seconds. Period: 60 Datapoints to alarm: 2 Evaluation periods: 2 Recommended alarms 426 Amazon CloudWatch User Guide Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD RollbackSegmentHistoryListLength Dimensions: DBInstanceIdentifier Alarm description: This alarm helps to monitor a consistent high rollback segment history length of an Aurora instance. A high InnoDB history list length indicates that a large number of old row versions, queries and database shutdowns have become slower. For more information and troubleshooting, see the InnoDB history list length increased significantly documentation. Intent: This alarm is used to detect consistent high rollback segment history length. This can help you prevent sustained performance degradation and high CPU usage in the Aurora instance. This alarm is recommended only for Aurora MySQL. Statistic: Average Recommended threshold: 1000000.0 Threshold justification: Setting this threshold to 1 million should give you time to investigate the problem. However, you can adjust this value based on your acceptable performance level and workload characteristics. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD StorageNetworkThroughput Dimensions: DBClusterIdentifier, Role=WRITER Alarm description: This alarm helps to monitor high storage network throughput. If storage network throughput passes the total network bandwidth of the EC2 instance, it can lead to high read and write latency, which can cause degraded performance. You can check your EC2 instance type from AWS Console. For troubleshooting, check any changes on write/read latencies and evaluate if you’ve also hit an alarm on this metric. If that is the case, evaluate your workload pattern during the times that the alarm was triggered. This can help you identify if you can optimize y our workload to reduce the total amount of network traffic. If this is not possible, you might need to consider scaling your instance. Recommended alarms 427 Amazon CloudWatch User Guide Intent: This alarm is used to detect high storage network throughput. Detecting high throughput can prevent network packet drops and degraded performance. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: You should calculate about |
acw-ug-152 | acw-ug.pdf | 152 | also hit an alarm on this metric. If that is the case, evaluate your workload pattern during the times that the alarm was triggered. This can help you identify if you can optimize y our workload to reduce the total amount of network traffic. If this is not possible, you might need to consider scaling your instance. Recommended alarms 427 Amazon CloudWatch User Guide Intent: This alarm is used to detect high storage network throughput. Detecting high throughput can prevent network packet drops and degraded performance. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: You should calculate about 80%-90% of the total network bandwidth of the EC2 instance type, and then use that result as the threshold value to proactively take action before the network packets are affected. You can also review the criticality and requirements of storage network throughput and analyze the historical behavior of this metric to determine sensible threshold levels. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Amazon Route 53 Public Data Plane HealthCheckStatus Dimensions: HealthCheckId Alarm description: This alarm helps to detect unhealthy endpoints as per health checkers. To understand the reason for a failure that results in unhealthy status, use the Health Checkers tab in the Route 53 Health Check Console to view the status from each Region as well as the last failure of the health check. The status tab also displays the reason that the endpoint is reported as unhealthy. Refer to troubleshooting steps. Intent: This alarm uses Route53 health checkers to detect unhealthy endpoints. Statistic: Average Recommended threshold: 1.0 Threshold justification: The status of the endpoint is reported as 1 when it's healthy. Everything less than 1 is unhealthy. Recommended alarms 428 User Guide Amazon CloudWatch Period: 60 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: LESS_THAN_THRESHOLD Amazon S3 4xxErrors Dimensions: BucketName, FilterId Alarm description: This alarm helps us report the total number of 4xx error status codes that are made in response to client requests. 403 error codes might indicate an incorrect IAM policy, and 404 error codes might indicate mis-behaving client application, for example. Enabling S3 server access logging on a temporary basis will help you to pinpoint the issue's origin using the fields HTTP status and Error Code. To understand more about the error code, see Error Responses. Intent: This alarm is used to create a baseline for typical 4xx error rates so that you can look into any abnormalities that might indicate a setup issue. Statistic: Average Recommended threshold: 0.05 Threshold justification: The recommended threshold is to detect if more than 5% of total requests are getting 4XX errors. Frequently occurring 4XX errors should be alarmed. However, setting a very low value for the threshold can cause alarm to be too sensitive. You can also tune the threshold to suit to the load of the requests, accounting for an acceptable level of 4XX errors. You can also analyze historical data to find the acceptable error rate for the application workload, and then tune the threshold accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 429 Amazon CloudWatch 5xxErrors Dimensions: BucketName, FilterId User Guide Alarm description: This alarm helps you detect a high number of server-side errors. These errors indicate that a client made a request that the server couldn’t complete. This can help you correlate the issue your application is facing because of S3. For more information to help you efficiently handle or reduce errors, see Optimizing performance design patterns. Errors might also be caused by an the issue with S3, check AWS service health dashboard for the status of Amazon S3 in your Region. Intent: This alarm can help to detect if the application is experiencing issues due to 5xx errors. Statistic: Average Recommended threshold: 0.05 Threshold justification: We recommend setting the threshold to detect if more than 5% of total requests are getting 5XXError. However, you can tune the threshold to suit the traffic of the requests, as well as acceptable error rates. You can also analyze historical data to see what is the acceptable error rate for the application workload, and tune the threshold accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD OperationsFailedReplication Dimensions: SourceBucket, DestinationBucket, RuleId Alarm description: This alarm helps in understanding a replication failure. This metric tracks the status of new objects replicated using S3 CRR or S3 SRR, and also tracks existing objects replicated using S3 batch replication. See Replication troubleshooting for more details. Intent: This alarm is used to detect if there is a failed replication operation. Statistic: Maximum Recommended threshold: 0.0 Recommended alarms 430 Amazon CloudWatch User Guide Threshold justification: This metric emits a value of 0 for successful operations, and nothing when there are no replication operations carried out |
acw-ug-153 | acw-ug.pdf | 153 | Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD OperationsFailedReplication Dimensions: SourceBucket, DestinationBucket, RuleId Alarm description: This alarm helps in understanding a replication failure. This metric tracks the status of new objects replicated using S3 CRR or S3 SRR, and also tracks existing objects replicated using S3 batch replication. See Replication troubleshooting for more details. Intent: This alarm is used to detect if there is a failed replication operation. Statistic: Maximum Recommended threshold: 0.0 Recommended alarms 430 Amazon CloudWatch User Guide Threshold justification: This metric emits a value of 0 for successful operations, and nothing when there are no replication operations carried out for the minute. When the metric emits a value greater than 0, the replication operation is unsuccessful. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD S3ObjectLambda 4xxErrors Dimensions: AccessPointName, DataSourceARN Alarm description: This alarm helps us report the total number of 4xx error status code that are made in response to client requests. Enabling S3 server access logging on a temporary basis will help you to pinpoint the issue's origin using the fields HTTP status and Error Code. Intent: This alarm is used to create a baseline for typical 4xx error rates so that you can look into any abnormalities that might indicate a setup issue. Statistic: Average Recommended threshold: 0.05 Threshold justification: We recommend setting the threshold to detect if more than 5% of total requests are getting 4XXError. Frequently occurring 4XX errors should be alarmed. However, setting a very low value for the threshold can cause alarm to be too sensitive. You can also tune the threshold to suit to the load of the requests, accounting for an acceptable level of 4XX errors. You can also analyze historical data to find the acceptable error rate for the application workload, and then tune the threshold accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Recommended alarms 431 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD 5xxErrors Dimensions: AccessPointName, DataSourceARN Alarm description: This alarm helps to detect high number of server-side errors. These errors indicate that a client made a request that the server couldn’t complete. These errors might be caused by an issue with S3, check AWS service health dashboard for the status of Amazon S3 in your Region. This can help you correlate the issue your application is facing because of S3. For information to help you efficiently handle or reduce these errors, see Optimizing performance design patterns. Intent: This alarm can help to detect if the application is experiencing issues due to 5xx errors. Statistic: Average Recommended threshold: 0.05 Threshold justification: We recommend setting the threshold to detect if more than 5% of total requests are getting 5XX errors. However, you can tune the threshold to suit the traffic of the requests, as well as acceptable error rates. You can also analyze historical data to see what is the acceptable error rate for the application workload, and tune the threshold accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD LambdaResponse4xx Dimensions: AccessPointName, DataSourceARN Alarm description: This alarm helps you detect and diagnose failures (500s) in calls to S3 Object Lambda. These errors can be caused by errors or misconfigurations in the Lambda function responsible for responding to your requests. Investigating the CloudWatch Log Streams of the Lambda function associated with the Object Lambda Access Point can help you pinpoint the issue's origin based on the response from S3 Object Lambda. Intent: This alarm is used to detect 4xx client errors for WriteGetObjectResponse calls. Recommended alarms 432 Amazon CloudWatch Statistic: Average Recommended threshold: 0.05 User Guide Threshold justification: We recommend setting the threshold to detect if more than 5% of total requests are getting 4XXError. Frequently occurring 4XX errors should be alarmed. However, setting a very low value for the threshold can cause alarm to be too sensitive. You can also tune the threshold to suit to the load of the requests, accounting for an acceptable level of 4XX errors. You can also analyze historical data to find the acceptable error rate for the application workload, and then tune the threshold accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_THRESHOLD Amazon SNS NumberOfMessagesPublished Dimensions: TopicName Alarm description: This alarm can detect when the number of SNS messages published is too low. For troubleshooting, check why the publishers are sending less traffic. Intent: This alarm helps you proactively monitor and detect significant drops in notification publishing. This helps you identify potential issues with your application or business processes, so that you can take appropriate actions to maintain the expected flow of notifications. You should create this alarm if you expect your system to have a minimum traffic that it is serving. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: The number of messages published should |
acw-ug-154 | acw-ug.pdf | 154 | description: This alarm can detect when the number of SNS messages published is too low. For troubleshooting, check why the publishers are sending less traffic. Intent: This alarm helps you proactively monitor and detect significant drops in notification publishing. This helps you identify potential issues with your application or business processes, so that you can take appropriate actions to maintain the expected flow of notifications. You should create this alarm if you expect your system to have a minimum traffic that it is serving. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: The number of messages published should be in line with the expected number of published messages for your application. You can also analyze the historical data, trends and traffic to find the right threshold. Period: 60 Recommended alarms 433 Amazon CloudWatch Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD NumberOfNotificationsDelivered Dimensions: TopicName User Guide Alarm description: This alarm can detect when the number of SNS messages delivered is too low. This could be because of unintentional unsubscribing of an endpoint, or because of an SNS event that causes messages to experience delay. Intent: This alarm helps you detect a drop in the volume of messages delivered. You should create this alarm if you expect your system to have a minimum traffic that it is serving. Statistic: Sum Recommended threshold: Depends on your situation Threshold justification: The number of messages delivered should be in line with the expected number of messages produced and the number of consumers. You can also analyze the historical data, trends and traffic to find the right threshold. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: LESS_THAN_THRESHOLD NumberOfNotificationsFailed Dimensions: TopicName Alarm description: This alarm can detect when the number of failed SNS messages is too high. To troubleshoot failed notifications, enable logging to CloudWatch Logs. Checking the logs can help you find which subscribers are failing, as well as the status codes they are returning. Intent: This alarm helps you proactively find issues with the delivery of notifications and take appropriate actions to address them. Statistic: Sum Recommended alarms 434 Amazon CloudWatch User Guide Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the impact of failed notifications. Review the SLAs provided to your end users, fault tolerance and criticality of notifications and analyze historical data, and then select a threshold accordingly. The number of notifications failed should be 0 for topics that have only SQS, Lambda or Firehose subscriptions. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD NumberOfNotificationsFilteredOut-InvalidAttributes Dimensions: TopicName Alarm description: This alarm helps to monitor and resolve potential problems with the publisher or subscribers. Check if a publisher is publishing messages with invalid attributes or if an inappropriate filter is applied to a subscriber. You can also analyze CloudWatch Logs to help find the root cause of the issue. Intent: The alarm is used to detect if the published messages are not valid or if inappropriate filters have been applied to a subscriber. Statistic: Sum Recommended threshold: 0.0 Threshold justification: Invalid attributes are almost always a mistake by the publisher. We recommend to set the threshold to 0 because invalid attributes are not expected in a healthy system. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD Recommended alarms 435 Amazon CloudWatch User Guide NumberOfNotificationsFilteredOut-InvalidMessageBody Dimensions: TopicName Alarm description: This alarm helps to monitor and resolve potential problems with the publisher or subscribers. Check if a publisher is publishing messages with invalid message bodies, or if an inappropriate filter is applied to a subscriber. You can also analyze CloudWatch Logs to help find the root cause of the issue. Intent: The alarm is used to detect if the published messages are not valid or if inappropriate filters have been applied to a subscriber. Statistic: Sum Recommended threshold: 0.0 Threshold justification: Invalid message bodies are almost always a mistake by the publisher. We recommend to set the threshold to 0 because invalid message bodies are not expected in a healthy system. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD NumberOfNotificationsRedrivenToDlq Dimensions: TopicName Alarm description: This alarm helps to monitor the number of messages that are moved to a dead-letter queue. Intent: The alarm is used to detect messages that moved to a dead-letter queue. We recommend that you create this alarm when SNS is coupled with SQS, Lambda or Firehose. Statistic: Sum Recommended threshold: 0.0 Threshold justification: In a healthy system of any subscriber type, messages should not be moved to the dead-letter queue. We recommend that you be notified if any messages land Recommended alarms 436 Amazon CloudWatch User Guide in the queue, so that you can identify and address the root cause, and |
acw-ug-155 | acw-ug.pdf | 155 | alarm helps to monitor the number of messages that are moved to a dead-letter queue. Intent: The alarm is used to detect messages that moved to a dead-letter queue. We recommend that you create this alarm when SNS is coupled with SQS, Lambda or Firehose. Statistic: Sum Recommended threshold: 0.0 Threshold justification: In a healthy system of any subscriber type, messages should not be moved to the dead-letter queue. We recommend that you be notified if any messages land Recommended alarms 436 Amazon CloudWatch User Guide in the queue, so that you can identify and address the root cause, and potentially redrive the messages in the dead-letter queue to prevent data loss. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD NumberOfNotificationsFailedToRedriveToDlq Dimensions: TopicName Alarm description: This alarm helps to monitor messages that couldn't be moved to a dead- letter queue. Check whether your dead-letter queue exists and that it's configured correctly. Also, verify that SNS has permissions to access the dead-letter queue. Refer to the dead-letter queue documentation to learn more. Intent: The alarm is used to detect messages that couldn't be moved to a dead-letter queue. Statistic: Sum Recommended threshold: 0.0 Threshold justification: It's almost always a mistake if messages can't be moved to the dead- letter queue. The recommendation for the threshold is 0, meaning all messages that fail processing must be able to reach the dead-letter queue when the queue has been configured. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD SMSMonthToDateSpentUSD Dimensions: TopicName Alarm description: The alarm helps to monitor if you have a sufficient quota in your account for SNS to be able to deliver messages. If you reach your quota, SNS won't be able to deliver SMS Recommended alarms 437 Amazon CloudWatch User Guide messages. For information about setting your monthly SMS spend quota, or for information about requesting a spend quota increase with AWS, see Setting SMS messaging preferences. Intent: This alarm is used to detect if you have a sufficient quota in your account for your SMS messages to be delivered successfully. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: Set the threshold in accordance with the quota (Account spend limit) for the account. Choose a threshold which informs you early enough that you are reaching your quota limit so that you have time to request an increase. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Comparison Operator: GREATER_THAN_THRESHOLD SMSSuccessRate Dimensions: TopicName Alarm description: This alarm helps to monitor the rate of failing SMS message deliveries. You can set up Cloudwatch Logs to understand the nature of the failure and take action based on that. Intent: This alarm is used to detect failing SMS message deliveries. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: Set the threshold for the alarm in line with your tolerance for failing SMS message deliveries. Period: 60 Datapoints to alarm: 5 Evaluation periods: 5 Recommended alarms 438 Amazon CloudWatch User Guide Comparison Operator: GREATER_THAN_THRESHOLD Amazon SQS ApproximateAgeOfOldestMessage Dimensions: QueueName Alarm description: This alarm watches the age of the oldest message in the queue. You can use this alarm to monitor if your consumers are processing SQS messages at the desired speed. Consider increasing the consumer count or consumer throughput to reduce message age. This metric can be used in combination with ApproximateNumberOfMessagesVisible to determine how big the queue backlog is and how quickly messages are being processed. To prevent messages from being deleted before processed, consider configuring the dead-letter queue to sideline potential poison pill messages. Intent: This alarm is used to detect whether the age of the oldest message in the QueueName queue is too high. High age can be an indication that messages are not processed quickly enough or that there are some poison-pill messages that are stuck in the queue and can't be processed. Statistic: Maximum Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the expected message processing time. You can use historical data to calculate the average message processing time, and then set the threshold to 50% higher than the maximum expected SQS message processing time by queue consumers. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD ApproximateNumberOfMessagesNotVisible Dimensions: QueueName Recommended alarms 439 Amazon CloudWatch User Guide Alarm description: This alarm helps to detect a high number of in-flight messages with respect to QueueName. For troubleshooting, check message backlog decreasing. Intent: This alarm is used to detect a high number of in-flight messages in the queue. If consumers do not delete messages within the visibility timeout period, when the queue is polled, messages reappear in the queue. For FIFO queues, there can be a maximum of 20,000 in-flight messages. If you reach this quota, SQS |
acw-ug-156 | acw-ug.pdf | 156 | Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD ApproximateNumberOfMessagesNotVisible Dimensions: QueueName Recommended alarms 439 Amazon CloudWatch User Guide Alarm description: This alarm helps to detect a high number of in-flight messages with respect to QueueName. For troubleshooting, check message backlog decreasing. Intent: This alarm is used to detect a high number of in-flight messages in the queue. If consumers do not delete messages within the visibility timeout period, when the queue is polled, messages reappear in the queue. For FIFO queues, there can be a maximum of 20,000 in-flight messages. If you reach this quota, SQS returns no error messages. A FIFO queue looks through the first 20k messages to determine available message groups. This means that if you have a backlog of messages in a single message group, you cannot consume messages from other message groups that were sent to the queue at a later time until you successfully consume the messages from the backlog. Statistic: Average Recommended threshold: Depends on your situation Threshold justification: The recommended threshold value for this alarm is highly dependent on the expected number of messages in flight. You can use historical data to calculate the maximum expected number of messages in flight and set the threshold to 50% over this value. If consumers of the queue are processing but not deleting messages from the queue, this number will suddenly increase. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD ApproximateNumberOfMessagesVisible Dimensions: QueueName Alarm description: This alarm watches for the message queue backlog to be bigger than expected, indicating that consumers are too slow or there are not enough consumers. Consider increasing the consumer count or speeding up consumers, if this alarm goes into ALARM state. Intent: This alarm is used to detect whether the message count of the active queue is too high and consumers are slow to process the messages or there are not enough consumers to process them. Statistic: Average Recommended alarms 440 Amazon CloudWatch User Guide Recommended threshold: Depends on your situation Threshold justification: An unexpectedly high number of messages visible indicates that messages are not being processed by a consumer at the expected rate. You should consider historical data when you set this threshold. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: GREATER_THAN_OR_EQUAL_TO_THRESHOLD NumberOfMessagesSent Dimensions: QueueName Alarm description: This alarm helps to detect if there are no messages being sent from a producer with respect to QueueName. For troubleshooting, check the reason that the producer is not sending messages. Intent: This alarm is used to detect when a producer stops sending messages. Statistic: Sum Recommended threshold: 0.0 Threshold justification: If the number of messages sent is 0, the producer is not sending any messages. If this queue has a low TPS, increase the number of EvaluationPeriods accordingly. Period: 60 Datapoints to alarm: 15 Evaluation periods: 15 Comparison Operator: LESS_THAN_OR_EQUAL_TO_THRESHOLD AWS VPN TunnelState Dimensions: VpnId Recommended alarms 441 Amazon CloudWatch User Guide Alarm description: This alarm helps you understand if the state of one or more tunnels is DOWN. For troubleshooting, see VPN tunnel troubleshooting. Intent: This alarm is used to detect if at least one tunnel is in the DOWN state for this VPN, so that you can troubleshoot the impacted VPN. This alarm will always be in the ALARM state for networks that only have a single tunnel configured. Statistic: Minimum Recommended threshold: 1.0 Threshold justification: A value less than 1 indicates that at least one tunnel is in DOWN state. Period: 300 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: LESS_THAN_THRESHOLD TunnelState Dimensions: TunnelIpAddress Alarm description: This alarm helps you understand if the state of this tunnel is DOWN. For troubleshooting, see VPN tunnel troubleshooting. Intent: This alarm is used to detect if the tunnel is in the DOWN state, so that you can troubleshoot the impacted VPN. This alarm will always be in the ALARM state for networks that only have a single tunnel configured. Statistic: Minimum Recommended threshold: 1.0 Threshold justification: A value less than 1 indicates that the tunnel is in DOWN state. Period: 300 Datapoints to alarm: 3 Evaluation periods: 3 Comparison Operator: LESS_THAN_THRESHOLD Recommended alarms 442 Amazon CloudWatch Alarming on metrics User Guide The steps in the following sections explain how to create CloudWatch alarms on metrics. Create a CloudWatch alarm based on a static threshold You choose a CloudWatch metric for the alarm to watch, and the threshold for that metric. The alarm goes to ALARM state when the metric breaches the threshold for a specified number of evaluation periods. If you are creating an alarm in an account set up as a monitoring account in CloudWatch cross- account observability, you can set up the alarm to watch a metric in a source account linked to this monitoring account. For |
acw-ug-157 | acw-ug.pdf | 157 | User Guide The steps in the following sections explain how to create CloudWatch alarms on metrics. Create a CloudWatch alarm based on a static threshold You choose a CloudWatch metric for the alarm to watch, and the threshold for that metric. The alarm goes to ALARM state when the metric breaches the threshold for a specified number of evaluation periods. If you are creating an alarm in an account set up as a monitoring account in CloudWatch cross- account observability, you can set up the alarm to watch a metric in a source account linked to this monitoring account. For more information, see CloudWatch cross-account observability. To create an alarm based on a single metric 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, All alarms. 3. Choose Create alarm. 4. Choose Select Metric. 5. Do one of the following: • • Choose the service namespace that contains the metric that you want. Continue choosing options as they appear to narrow the choices. When a list of metrics appears, select the check box next to the metric that you want. In the search box, enter the name of a metric, account ID, account label, dimension, or resource ID. Then, choose one of the results and continue until a list of metrics appears. Select the check box next to the metric that you want. 6. Choose the Graphed metrics tab. a. Under Statistic , choose one of the statistics or predefined percentiles, or specify a custom percentile (for example, p95.45). b. Under Period, choose the evaluation period for the alarm. When evaluating the alarm, each period is aggregated into one data point. You can also choose whether the y-axis legend appears on the left or right while you're creating the alarm. This preference is used only while you're creating the alarm. Alarming on metrics 443 Amazon CloudWatch c. Choose Select metric. User Guide The Specify metric and conditions page appears, showing a graph and other information about the metric and statistic that you selected. 7. Under Conditions, specify the following: a. For Whenever metric is, specify whether the metric must be greater than, less than, or equal to the threshold. Under than..., specify the threshold value. b. Choose Additional configuration. For Datapoints to alarm, specify how many evaluation periods (data points) must be in the ALARM state to trigger the alarm. If the two values here match, you create an alarm that goes to ALARM state if that many consecutive periods are breaching. c. d. To create an M out of N alarm, specify a lower number for the first value than you specify for the second value. For more information, see Evaluating an alarm. For Missing data treatment, choose how to have the alarm behave when some data points are missing. For more information, see Configuring how CloudWatch alarms treat missing data. If the alarm uses a percentile as the monitored statistic, a Percentiles with low samples box appears. Use it to choose whether to evaluate or ignore cases with low sample rates. If you choose ignore (maintain alarm state), the current alarm state is always maintained when the sample size is too low. For more information, see Percentile-based CloudWatch alarms and low data samples. 8. Choose Next. 9. Under Notification, select an SNS topic to notify when the alarm is in ALARM state, OK state, or INSUFFICIENT_DATA state. To have the alarm send multiple notifications for the same alarm state or for different alarm states, choose Add notification. In CloudWatch cross-account observability, you can choose to have notifications sent to multiple AWS accounts. For example, to both the monitoring account and the source account. To have the alarm not send notifications, choose Remove. 10. To have the alarm perform Auto Scaling, EC2, Lambda, investigation, or Systems Manager actions, choose the appropriate button and choose the alarm state and action to perform. Alarms can perform Systems Manager actions and investigation actions only when they go Create an alarm based on a static threshold 444 Amazon CloudWatch User Guide into ALARM state. For more information about Systems Manager actions, see Configuring CloudWatch to create OpsItems from alarms and Incident creation. To have the alarm start an investigation, choose Add investigation action and then select your investigation group. For more information about Amazon Q Developer operational investigations, see Amazon Q Developer operational investigations (Preview). Note To create an alarm that performs an SSM Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager. 11. When finished, choose Next. 12. Enter a name and description for the alarm. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in |
acw-ug-158 | acw-ug.pdf | 158 | investigation, choose Add investigation action and then select your investigation group. For more information about Amazon Q Developer operational investigations, see Amazon Q Developer operational investigations (Preview). Note To create an alarm that performs an SSM Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager. 11. When finished, choose Next. 12. Enter a name and description for the alarm. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. Then choose Next. 13. Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm. You can also add alarms to a dashboard. For more information, see Adding an alarm to a CloudWatch dashboard. Create a CloudWatch alarm based on a metric math expression To create an alarm based on a metric math expression, choose one or more CloudWatch metrics to use in the expression. Then, specify the expression, threshold, and evaluation periods. You can't create an alarm based on the SEARCH expression. This is because search expressions return multiple time series, and an alarm based on a math expression can watch only one time series. To create an alarm that's based on a metric math expression 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, and then choose All alarms. 3. Choose Create alarm. Create an alarm based on a metric math expression 445 Amazon CloudWatch User Guide 4. Choose Select Metric, and then perform one of the following actions: • • Select a namespace from the AWS namespaces dropdown or Custom namespaces dropdown. After you select a namespace, you continue choosing options until a list of metrics appears, where you select the checkbox next to the correct metric. Use the search box to find a metric, account ID, dimension, or resource ID. After you enter the metric, dimension, or resource ID, you continue choosing options until a list of metrics appears, where you select the check box next to the correct metric. 5. (Optional) If you want to add another metric to a metric math expression, you can use the search box to find a specific metric. You can add as many as 10 metrics to a metric math expression. 6. Select the Graphed metrics tab. For each of the metrics that you previously added, perform the following actions: a. Under the Statistic column, select the dropdown menu. In the dropdown menu, choose one of the predefined statistics or percentiles. Use the search box in the dropdown menu to specify a custom percentile. b. Under the Period column, select the dropdown menu. In the dropdown menu, choose one of the predefined evaluation periods. While you're creating your alarm, you can specify whether the Y-axis legend appears on the left or right side of your graph. Note When CloudWatch evaluates alarms, periods are aggregated into single data points. 7. Choose the Add math dropdown, and then select Start with an empty expression from the list of predefined metric math expressions. After you choose Start with an empty expression, a math expression box appears where you apply or edit math expressions. 8. In the math expression box, enter your math expression, and then choose Apply. After you choose Apply, an ID column appears next to the Label column. To use a metric or the result of another metric math expression as part of your current math expression's formula, you use the value that's shown under the ID column. To change the value Create an alarm based on a metric math expression 446 Amazon CloudWatch User Guide of ID, you select the pen-and-paper icon next to the current value. The new value must begin with a lowercase letter and can include numbers, letters, and the underscore symbol. Changing the value of ID to a more significant name can make your alarm graph easier to understand. For information about the functions that are available for metric math, see Metric math syntax and functions. 9. (Optional) Add more math expressions, using both metrics and the results of other math expressions in the formulas of the new math expressions. 10. When you have the expression to use for the alarm, clear the check boxes to the left of every other expression and every metric on the page. Only the check box next to the expression to use for the alarm should be selected. The expression that you choose for the alarm must produce a single time series and show only one line on the graph. Then choose Select metric. The Specify metric and conditions page |
acw-ug-159 | acw-ug.pdf | 159 | 9. (Optional) Add more math expressions, using both metrics and the results of other math expressions in the formulas of the new math expressions. 10. When you have the expression to use for the alarm, clear the check boxes to the left of every other expression and every metric on the page. Only the check box next to the expression to use for the alarm should be selected. The expression that you choose for the alarm must produce a single time series and show only one line on the graph. Then choose Select metric. The Specify metric and conditions page appears, showing a graph and other information about the math expression that you have selected. 11. For Whenever expression is, specify whether the expression must be greater than, less than, or equal to the threshold. Under than..., specify the threshold value. 12. Choose Additional configuration. For Datapoints to alarm, specify how many evaluation periods (data points) must be in the ALARM state to trigger the alarm. If the two values here match, you create an alarm that goes to ALARM state if that many consecutive periods are breaching. To create an M out of N alarm, specify a lower number for the first value than you specify for the second value. For more information, see Evaluating an alarm. 13. For Missing data treatment, choose how to have the alarm behave when some data points are missing. For more information, see Configuring how CloudWatch alarms treat missing data. 14. Choose Next. 15. Under Notification, select an SNS topic to notify when the alarm is in ALARM state, OK state, or INSUFFICIENT_DATA state. To have the alarm send multiple notifications for the same alarm state or for different alarm states, choose Add notification. To have the alarm not send notifications, choose Remove. 16. To have the alarm perform Auto Scaling, EC2, Lambda, or Systems Manager actions, choose the appropriate button and choose the alarm state and action to perform. If you choose a Create an alarm based on a metric math expression 447 Amazon CloudWatch User Guide Lambda function as an alarm action, you specify the function name or ARN, and you can optionally choose a specific version of the function. Alarms can perform Systems Manager actions only when they go into ALARM state. For more information about Systems Manager actions, see see Configuring CloudWatch to create OpsItems from alarms and Incident creation. Note To create an alarm that performs an SSM Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager. 17. When finished, choose Next. 18. Enter a name and description for the alarm. Then choose Next. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. 19. Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm. You can also add alarms to a dashboard. For more information, see Adding an alarm to a CloudWatch dashboard. Create a CloudWatch alarm based on a Metrics Insights query You can create an alarm on any Metrics Insights query that returns a single time series. This can be especially useful to create dynamic alarms that watch aggregated metrics across a fleet of your infrastructure or applications. Create the alarm once, and it adjusts as resources are added to or removed from the fleet. For example, you can create an alarm that watches the CPU ulitization of all your instances, and the alarm dynamically adjusts as you add or remove instances. For complete instructions, see Alarms on CloudWatch Metrics Insights queries in CloudWatch. Create an alarm based on a Metrics Insights query 448 Amazon CloudWatch User Guide Create an alarm based on a connected data source You can create alarms that watch metrics from data sources that aren't in CloudWatch. For more information about creating connections to these other data sources, see Query metrics from other data sources. To create an alarm on metrics from a data source that you have connected to 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the Multi source query tab. 4. 5. For Data source, select the data source that you want to use. The query builder prompts you for the information necessary for the query to retrieve the metrics to use for the alarm. The workflow is different for each data source, and is tailored to the data source. For example, for Amazon Managed Service for Prometheus and Prometheus data sources, a PromQL query editor box with a query helper appears. |
acw-ug-160 | acw-ug.pdf | 160 | that you have connected to 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, All metrics. 3. Choose the Multi source query tab. 4. 5. For Data source, select the data source that you want to use. The query builder prompts you for the information necessary for the query to retrieve the metrics to use for the alarm. The workflow is different for each data source, and is tailored to the data source. For example, for Amazon Managed Service for Prometheus and Prometheus data sources, a PromQL query editor box with a query helper appears. 6. When you have finished constructing the query, choose Graph query. 7. 8. If the sample graph looks the way that you expect, choose Create alarm. The Specify metric and conditions page appears. If the query you are using produces more than one time series, you see a warning banner at the top of the page. If you do, select a function to use to aggregate the time series in Aggregation function. 9. (Optional) Add a Label for the alarm. 10. For Whenever your-metric-name is . . ., choose Greater, Greater/Equal, Lower/Equal, or Lower. Then for than . . ., specify a number for your threshold value. 11. Choose Additional configuration. For Datapoints to alarm, specify how many evaluation periods (data points) must be in the ALARM state to trigger the alarm. If the two values here match, you create an alarm that goes to ALARM state if that many consecutive periods are breaching. To create an M out of N alarm, specify a number for the first value that is lower than the number for the second value. For more information, see Evaluating an alarm. 12. For Missing data treatment, choose how the alarm behaves when some data points are missing. For more information, see Configuring how CloudWatch alarms treat missing data. 13. Choose Next. Create an alarm based on a connected data source 449 Amazon CloudWatch User Guide 14. For Notification, specify an Amazon SNS topic to notify when your alarm transitions to the ALARM, OK, or INSUFFICIENT_DATA state. a. (Optional) To send multiple notifications for the same alarm state or for different alarm states, choose Add notification. Note We recommend that you set the alarm to take actions when it goes into Insufficient data state in addition to when it goes into Alarm state. This is because many issues with the Lambda function that connects to the data source can cause the alarm to transition to Insufficient data. b. (Optional) To not send Amazon SNS notifications, choose Remove. 15. To have the alarm perform Auto Scaling, Lambda, or Systems Manager actions, choose the appropriate button and choose the alarm state and action to perform. If you choose a Lambda function as an alarm action, you specify the function name or ARN, and you can optionally choose a specific version of the function. Alarms can perform Systems Manager actions only when they go into ALARM state. For more information about Systems Manager actions, see see Configuring CloudWatch to create OpsItems from alarms and Incident creation. Note To create an alarm that performs an SSM Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager. 16. Choose Next. 17. Under Name and description, enter a name and description for your alarm, and choose Next. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. Create an alarm based on a connected data source 450 Amazon CloudWatch Tip User Guide The alarm name must contain only UTF-8 characters. It can't contain ASCII control characters. 18. Under Preview and create, confirm that your alarm's information and conditions are correct, and choose Create alarm. Details about alarms for connected data sources • When CloudWatch evaluates an alarm, it does so every minute, even if the period for the alarm is longer than one minute. For the alarm to work, the Lambda function must be able to return a list of timestamps starting on any minute, not only on multiples of the period length. These timestamps must be spaced one period length apart. Therefore, if the data source queried by the Lambda can only return timestamps that are multiples of the period length, the function should "re-sample" the fetched data to match the timestamps expected by the GetMetricData request. For example, an alarm with a five-minute period is evaluated every minute using five-minute windows that shift by one minute each time. In this case: • For the alarm evaluation at 12:15:00, CloudWatch expects data points with |
acw-ug-161 | acw-ug.pdf | 161 | to return a list of timestamps starting on any minute, not only on multiples of the period length. These timestamps must be spaced one period length apart. Therefore, if the data source queried by the Lambda can only return timestamps that are multiples of the period length, the function should "re-sample" the fetched data to match the timestamps expected by the GetMetricData request. For example, an alarm with a five-minute period is evaluated every minute using five-minute windows that shift by one minute each time. In this case: • For the alarm evaluation at 12:15:00, CloudWatch expects data points with timestamps of 12:00:00, 12:05:00, and 12:10:00. • Then for the alarm evaluation at 12:16:00, CloudWatch expects data points with timestamps of 12:01:00, 12:06:00, and 12:11:00. • When CloudWatch evaluates an alarm, any data points returned by the Lambda function that don't align with the expected timestamps are dropped, and the alarm is evaluated using the remaining expected data points. For example, when the alarm is evaluated at 12:15:00 it expects data with timestamps of 12:00:00, 12:05:00, and 12:10:00. If it receives data with timestamps of 12:00:00, 12:05:00, 12:06:00, and 12:10:00, the data from 12:06:00 is dropped and CloudWatch evaluates the alarm using the other timestamps. Then for the next evaluation at 12:16:00, it expects data with timestamps of 12:01:00, 12:06:00, and 12:11:00. If it only has the data with timestamps of 12:00:00, 12:05:00, and 12:10:00, all of these data points are ignored at 12:16:00 and the alarm transitions into the Create an alarm based on a connected data source 451 Amazon CloudWatch User Guide state according to how you specified the alarm to treat missing data. For more information, see Evaluating an alarm. • We recommend that you create these alarms to take actions when they transition to the INSUFFICIENT_DATA state, because several Lambda function failure use cases will transition the alarm to INSUFFICIENT_DATA regardless of the way that you set the alarm to treat missing data. • If the Lambda function returns an error: • If there is a permission problem with calling the Lambda function, the alarm begins having missing data transitions according to how you specified the alarm to treat missing data when you created it. • Any other error coming from the Lambda function causes the alarm to transition to INSUFFICIENT_DATA. • If the Lambda function returns partial data: • The alarm continues to be evaluated on the data points that are returned. • You can use the following methods to find whether an alarm on a Lambda function is currently evaluating its alarm state based on partial data: • In the console, choose an alarm and choose the Details page. If you see the message Evaluation warning: Not evaluating all data appears on that page, it is evaluating on partial data. • If you see the value PARTIAL_DATA in the EvaluationState field when you use the describe-alarms AWS CLI command or the DescribeAlarms API, it is evaluating on partial data. • An alarm also publishes events to Amazon EventBridge when it goes into the partial data state. • If the metric requested by the Lambda function has some delay so that the last data point is always missing, you should use a workaround. You can create an M out of N alarm or increase the evaluation period of the alarm. For more information about M out of N alarms, see Evaluating an alarm. Create a CloudWatch alarm based on anomaly detection You can create an alarm based on CloudWatch anomaly detection, which analyzes past metric data and creates a model of expected values. The expected values take into account the typical hourly, daily, and weekly patterns in the metric. Create an alarm based on anomaly detection 452 Amazon CloudWatch User Guide You set a value for the anomaly detection threshold, and CloudWatch uses this threshold with the model to determine the "normal" range of values for the metric. A higher value for the threshold produces a thicker band of "normal" values. You can choose whether the alarm is triggered when the metric value is above the band of expected values, below the band, or either above or below the band. You also can create anomaly detection alarms on single metrics and the outputs of metric math expressions. You can use these expressions to create graphs that visualize anomaly detection bands. In an account set up as a monitoring account for CloudWatch cross-account observability, you can create anomaly detectors on metrics in source accounts in addition to metrics in the monitoring account. For more information, see Using CloudWatch anomaly detection. Note If you're already using anomaly detection for visualization purposes on a metric in the Metrics console and you create an anomaly detection alarm on that same metric, then the threshold that you set for the |
acw-ug-162 | acw-ug.pdf | 162 | detection alarms on single metrics and the outputs of metric math expressions. You can use these expressions to create graphs that visualize anomaly detection bands. In an account set up as a monitoring account for CloudWatch cross-account observability, you can create anomaly detectors on metrics in source accounts in addition to metrics in the monitoring account. For more information, see Using CloudWatch anomaly detection. Note If you're already using anomaly detection for visualization purposes on a metric in the Metrics console and you create an anomaly detection alarm on that same metric, then the threshold that you set for the alarm doesn't change the threshold that you already set for visualization. For more information, see Creating a graph. To create an alarm that's based on anomaly detection 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, All alarms. 3. Choose Create alarm. 4. Choose Select Metric. 5. Do one of the following: • • Choose the service namespace that contains your metric, and then continue choosing options as they appear to narrow down your options. When a list of metrics appears, select the check box that's next to your metric. In the search box, enter the name of a metric, dimension, or resource ID. Select one of the results, and then continue choosing options as they appear until a list of metrics appears. Select the check box that's next to your metric. Create an alarm based on anomaly detection 453 Amazon CloudWatch 6. Choose Graphed metric. User Guide a. (Optional) For Statistic, choose the dropdown, and then select one of the predefined statistics or percentiles. You can use the search box in the dropdown to specify a custom percentile, such as p95.45. b. (Optional) For Period, choose the dropdown, and then select one of the predefined evaluation periods. Note When CloudWatch evaluates your alarm, it aggragates the period into a single datapoint. For an anomaly detection alarm, the evaluation period must be one minute or longer. 7. Choose Next. 8. Under Conditions, specify the following: a. Choose Anomaly detection. If the model for this metric and statistic already exists, CloudWatch displays a preview of the anomaly detection band in the graph at the top of the screen. After you create your alarm, it can take up to 15 minutes for the actual anomaly detection band to appear in the graph. Before that, the band that you see is an approximation of the anomaly detection band. Tip To see the graph at the top of the screen in a longer time frame, choose Edit at the top-right of the screen. If the model for this metric and statistic doesn't already exist, CloudWatch generates the anomaly detection band after you finish creating your alarm. For new models, it can take up to 3 hours for the actual anomaly detection band to appear in your graph. It can take up to two weeks for the new model to train, so the anomaly detection band shows more accurate expected values. b. For Whenever metric is, specify when to trigger the alarm. For example, when the metric is greater than, lower than, or outside the band (in either direction). Create an alarm based on anomaly detection 454 Amazon CloudWatch User Guide c. For Anomaly detection threshold, choose the number to use for the anomaly detection threshold. A higher number creates a thicker band of "normal" values that is more tolerant of metric changes. A lower number creates a thinner band that will go to ALARM state with smaller metric deviations. The number does not have to be a whole number. d. Choose Additional configuration. For Datapoints to alarm, specify how many evaluation periods (data points) must be in the ALARM state to trigger the alarm. If the two values here match, you create an alarm that goes to ALARM state if that many consecutive periods are breaching. e. f. To create an M out of N alarm, specify a number for the first value that is lower than the number for the second value. For more information, see Evaluating an alarm. For Missing data treatment, choose how the alarm behaves when some data points are missing. For more information, see Configuring how CloudWatch alarms treat missing data. If the alarm uses a percentile as the monitored statistic, a Percentiles with low samples box appears. Use it to choose whether to evaluate or ignore cases with low sample rates. If you choose Ignore (maintain alarm state), the current alarm state is always maintained when the sample size is too low. For more information, see Percentile-based CloudWatch alarms and low data samples. 9. Choose Next. 10. Under Notification, select an SNS topic to notify when the alarm is in ALARM state, OK state, or INSUFFICIENT_DATA state. To send multiple notifications for the |
acw-ug-163 | acw-ug.pdf | 163 | Configuring how CloudWatch alarms treat missing data. If the alarm uses a percentile as the monitored statistic, a Percentiles with low samples box appears. Use it to choose whether to evaluate or ignore cases with low sample rates. If you choose Ignore (maintain alarm state), the current alarm state is always maintained when the sample size is too low. For more information, see Percentile-based CloudWatch alarms and low data samples. 9. Choose Next. 10. Under Notification, select an SNS topic to notify when the alarm is in ALARM state, OK state, or INSUFFICIENT_DATA state. To send multiple notifications for the same alarm state or for different alarm states, choose Add notification. Choose Remove if you don't want the alarm to send notifications. 11. You can set up the alarm to perform EC2 actions or invoke a Lambda function when it changes state, or to create a Systems Manager OpsItem or incident when it goes into ALARM state. To do this, choose the appropriate button and then choose the alarm state and action to perform. If you choose a Lambda function as an alarm action, you specify the function name or ARN, and you can optionally choose a specific version of the function. For more information about Systems Manager actions, see Configuring CloudWatch to create OpsItems from alarms and Incident creation. Create an alarm based on anomaly detection 455 Amazon CloudWatch Note User Guide To create an alarm that performs an AWS Systems Manager Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager. 12. Choose Next. 13. Under Name and description, enter a name and description for your alarm, and choose Next. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. Tip The alarm name must contain only UTF-8 characters, and can't contain ASCII control characters 14. Under Preview and create, confirm that your alarm's information and conditions are correct, and choose Create alarm. Editing an anomaly detection model After you create an alarm, you can adjust the anomaly detection model. You can exclude certain time periods from being used in the model creation. It is critical that you exclude unusual events such as system outages, deployments, and holidays from the training data. You can also specify whether to adjust the model for Daylight Savings Time changes. To edit the anomaly detection model for an alarm 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, All alarms. 3. Choose the name of the alarm. If necessary, use the search box to find the alarm. 4. Choose View, In metrics. 5. In the Details column, choose the ANOMALY_DETECTION_BAND keyword, and then choose Edit anomaly detection model in the popup. Editing an anomaly detection model 456 Amazon CloudWatch User Guide 6. 7. To exclude a time period from being used to produce the model, choose the calendar icon by End date. Then, select or enter the days and times to exclude from training and choose Apply. If the metric is sensitive to Daylight Savings Time changes, select the appropriate time zone in the Metric timezone box. 8. Choose Update. Deleting an anomaly detection model Using anomaly detection for an alarm accrues charges. As a best practice, if your alarm no longer needs an anomaly detection model, delete the alarm first and the model second. When anomaly detection alarms are evaluated, any missing anomaly detectors are created on your behalf. If you delete the model without deleting the alarm, the alarm automatically recreates the model. To delete an alarm 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Alarms, All Alarms. 3. Choose the name of the alarm. 4. Choose Actions, Delete. 5. In the confirmation box, choose Delete. To delete an anomaly detection model that was used for an alarm 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Metrics, and then choose All metrics. Deleting an anomaly detection model 457 Amazon CloudWatch User Guide 3. Choose Browse, and then select the metric that includes the anomaly detection model. You can search for your metric in the search box or select your metric by choosing through the options. • (Optional) If you're using the original interface, choose All metrics, and then choose the metric that includes the anomaly detection model. You can search for your metric in the search box or select your metric by choosing through the options. 4. Choose Graphed metrics. 5. In the Graphed metrics tab, in the Details column, choose the ANOMALY_DETECTION_BAND keyword, and then choose Delete |
acw-ug-164 | acw-ug.pdf | 164 | Amazon CloudWatch User Guide 3. Choose Browse, and then select the metric that includes the anomaly detection model. You can search for your metric in the search box or select your metric by choosing through the options. • (Optional) If you're using the original interface, choose All metrics, and then choose the metric that includes the anomaly detection model. You can search for your metric in the search box or select your metric by choosing through the options. 4. Choose Graphed metrics. 5. In the Graphed metrics tab, in the Details column, choose the ANOMALY_DETECTION_BAND keyword, and then choose Delete anomaly detection model in the popup. • (Optional) If you're using the original interface, choose Edit model. You're directed to a new screen. On the new screen, choose Delete model, and then choose Delete. Alarming on logs The steps in the following sections explain how to create CloudWatch alarms on logs. Create a CloudWatch alarm based on a log group-metric filter The procedure in this section describes how to create an alarm based on a log group-metric filter. With metric filters, you can look for terms and patterns in log data as the data is sent to CloudWatch. For more information, see Create metrics from log events using filters in the Amazon CloudWatch Logs User Guide. Before you create an alarm based on a log group-metric filter, you must complete the following actions: • Create a log group. For more information, see Working with log groups and log streams in the Amazon CloudWatch Logs User Guide. Alarming on logs 458 Amazon CloudWatch User Guide • Create a metric filter. For more information, see Create a metric filter for a log group in the Amazon CloudWatch Logs User Guide. To create an alarm based on a log group-metric filter 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. From the navigation pane, choose Logs, and then choose Log groups. 3. Choose the log group that includes your metric filter. 4. Choose Metric filters. 5. In the metric filters tab, select the box for the metric filter that you want to base your alarm on. 6. Choose Create alarm. 7. (Optional) Under Metric, edit Metric name, Statistic, and Period. 8. Under Conditions, specify the following: a. b. For Threshold type, choose Static or Anomaly detection. For Whenever your-metric-name is . . ., choose Greater, Greater/Equal, Lower/Equal , or Lower. c. For than . . ., specify a number for your threshold value. 9. Choose Additional configuration. a. For Data points to alarm, specify how many data points trigger your alarm to go into the ALARM state. If you specify matching values, your alarm goes into the ALARM state if that many consecutive periods are breaching. To create an M-out-of-N alarm, specify a number for the first value that's lower than the number you specify for the second value. For more information, see Using Amazon CloudWatch alarms. b. For Missing data treatment, select an option to specify how to treat missing data when your alarm is evaluated. 10. Choose Next. 11. For Notification, specify an Amazon SNS topic to notify when your alarm is in the ALARM, OK, or INSUFFICIENT_DATA state. a. (Optional) To send multiple notifications for the same alarm state or for different alarm states, choose Add notification. b. (Optional) To not send notifications, choose Remove. Create an alarm based on a log group-metric filter 459 Amazon CloudWatch User Guide 12. To have the alarm perform Auto Scaling, EC2, Lambda, or Systems Manager actions, choose the appropriate button and choose the alarm state and action to perform. If you choose a Lambda function as an alarm action, you specify the function name or ARN, and you can optionally choose a specific version of the function. Alarms can perform Systems Manager actions only when they go into ALARM state. For more information about Systems Manager actions, see see Configuring CloudWatch to create OpsItems from alarms and Incident creation. Note To create an alarm that performs an SSM Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager. 13. Choose Next. 14. For Name and description, enter a name and description for your alarm. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. 15. For Preview and create, check that your configuration is correct, and choose Create alarm. Combining alarms With CloudWatch, you can combine several alarms into one composite alarm to create a summarized, aggregated health indicator over a whole application or group of resources. Composite alarms are alarms that determine their state by monitoring |
acw-ug-165 | acw-ug.pdf | 165 | alarm. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. 15. For Preview and create, check that your configuration is correct, and choose Create alarm. Combining alarms With CloudWatch, you can combine several alarms into one composite alarm to create a summarized, aggregated health indicator over a whole application or group of resources. Composite alarms are alarms that determine their state by monitoring the states of other alarms. You define rules to combine the status of those monitored alarms using Boolean logic. You can use composite alarms to reduce alarm noise by taking actions only at an aggregated level. For example, you can create a composite alarm to send a notification to your web server team if any alarm related to your web server triggers. When any of those alarms goes into the ALARM state, the composite alarm goes itself in the ALARM state and sends a notification to your team. If other alarms related to your web server also go into the ALARM state, your team does not get overloaded with new notifications since the composite alarm has already notified them about the existing situation. Combining alarms 460 Amazon CloudWatch User Guide You can also use composite alarms to create complex alarming conditions and take actions only when many different conditions are met. For example, you can create a composite alarm that combines a CPU alarm and a memory alarm, and would only notify your team if both the CPU and the memory alarms have triggered. Using composite alarms When you use composite alarms, you have two options: • Configure the actions you want to take only at the composite alarm level, and create the underlying monitored alarms without actions • Configure a different set of actions at the composite alarm level. For example, the composite alarm actions could engage a different team in case of a widespread issue. Composite alarms can take only the following actions: • Notify Amazon SNS topics • Invoke Lambda functions • Create OpsItems in Systems Manager Ops Center • Create incidents in Systems Manager Incident Manager Note All the underlying alarms in your composite alarm must be in the same account and the same Region as your composite alarm. However, if you set up a composite alarm in a CloudWatch cross-account observability monitoring account, the underlying alarms can watch metrics in different source accounts and in the monitoring account itself. For more information, see CloudWatch cross-account observability. A single composite alarm can monitor 100 underlying alarms, and 150 composite alarms can monitor a single underlying alarm. Rule expressions All composite alarms contain rule expressions. Rule expressions tell composite alarms which other alarms to monitor and determine their states from. Rule expressions can refer to metric alarms and Combining alarms 461 Amazon CloudWatch User Guide composite alarms. When you reference an alarm in a rule expression, you designate a function to the alarm that determines which of the following three states the alarm will be in: • ALARM ALARM ("alarm-name or alarm-ARN") is TRUE if the alarm is in ALARM state. • OK OK ("alarm-name or alarm-ARN") is TRUE if the alarm is in OK state. • INSUFFICIENT_DATA INSUFFICIENT_DATA (“alarm-name or alarm-ARN") is TRUE if the named alarm is in INSUFFICIENT_DATA state. Note TRUE always evaluates to TRUE, and FALSE always evaluates to FALSE. Example expressions The request parameter AlarmRule supports the use of the logical operators AND, OR, and NOT, so you can combine multiple functions into a single expressions. The following example expressions show how you can configure the underlying alarms in your composite alarm: • ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh) The expression specifies that the composite alarm goes into ALARM only if CPUUtilizationTooHigh and DiskReadOpsTooHigh are in ALARM. • ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress) The expression specifies that the composite alarm goes into ALARM if CPUUtilizationTooHigh is in ALARM and DeploymentInProgress is not in ALARM. This is an example of a composite alarm that reduces alarm noise during a deployment window. • (ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh) Combining alarms 462 Amazon CloudWatch User Guide The expression specifies that the composite alarm goes into ALARM if (ALARM(CPUUtilizationTooHigh) or (DiskReadOpsTooHigh) is in ALARM and (NetworkOutTooHigh) is in OK. This is an example of a composite alarm that reduces alarm noise by not sending you notifications when either of the underlying alarms aren’t in ALARM while a network issue is occurring. Topics • Create a composite alarm • Suppressing composite alarm actions Create a composite alarm The steps in this section explain how to use the CloudWatch console to create a composite alarm. You can also use the API or |
acw-ug-166 | acw-ug.pdf | 166 | Combining alarms 462 Amazon CloudWatch User Guide The expression specifies that the composite alarm goes into ALARM if (ALARM(CPUUtilizationTooHigh) or (DiskReadOpsTooHigh) is in ALARM and (NetworkOutTooHigh) is in OK. This is an example of a composite alarm that reduces alarm noise by not sending you notifications when either of the underlying alarms aren’t in ALARM while a network issue is occurring. Topics • Create a composite alarm • Suppressing composite alarm actions Create a composite alarm The steps in this section explain how to use the CloudWatch console to create a composite alarm. You can also use the API or AWS CLI to create a composite alarm. For more information, see PutCompositeAlarm or put-composite-alarm To create a composite alarm 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Alarms, and then choose All alarms. From the list of alarms, select the check box next to each of the existing alarms that you want to reference in your rule expression, and then choose Create composite alarm. 4. Under Specify composite alarm conditions, specify the rule expression for your new composite alarm. Note Automatically, the alarms that you selected from the list of alarms are listed in the Conditions box. By default, the ALARM function has been designated to each of your alarms, and each of your alarms is joined by the logical operator OR. You can use the following substeps to modify your rule expression: a. You can change the required state for each of your alarms from ALARM to OK or INSUFFICIENT_DATA. Create a composite alarm 463 Amazon CloudWatch User Guide b. You can change the logical operator in your rule expression from OR to AND or NOT, and you can add parentheses to group your functions. c. You can include other alarms in your rule expression or delete alarms from your rule expression. Example: Rule expression with conditions (ALARM("CPUUtilizationTooHigh") OR ALARM("DiskReadOpsTooHigh")) AND OK("NetworkOutTooHigh") In the example rule expression where the composite alarm goes into ALARM when ALARM ("CPUUtilizationTooHigh" or ALARM("DiskReadOpsTooHigh") is in ALARM at the same time as OK("NetworkOutTooHigh") is in OK. 5. When finished, choose Next. 6. Under Configure actions, you can choose from the following: For Notification • Select an exisiting SNS topic, Create a new SNS topic, or Use a topic ARN to define the SNS topic that will receive the notification. • Add notification, so your alarm can send multiple notifications for the same alarm state or different alarm states. • Remove to stop your alarm from sending notifications or taking actions. (Optional) To have the alarm invoke a Lambda function when it changes state, choose Add Lambda action. Then specify the function name or ARN, and optionally choose a specific version of the function. For Systems Manager action • Add Systems Manager action, so your alarm can perform an SSM action when it goes into ALARM. To learn more about Systems Manager actions, see Configuring CloudWatch to create OpsItems from alarms in the AWS Systems Manager User Guide and Incident creation in the Create a composite alarm 464 Amazon CloudWatch User Guide Incident Manager User Guide. To create an alarm that performs an SSM Incident Manager action, you must have the correct permissions. For more information, see Identity-based policy examples for AWS Systems Manager Incident Manager in the Incident Manager User Guide. To have the alarm start an investigation, choose Add investigation action and then select your investigation group. For more information about Amazon Q Developer operational investigations, see Amazon Q Developer operational investigations (Preview). 7. When finished, choose Next. 8. Under Add name and description, enter an alarm name and optional description for your new composite alarm. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. 9. When finished, choose Next. 10. Under Preview and create, confirm your information, and then choose Create composite alarm. Note You can create a cycle of composite alarms, where one composite alarm and another composite alarm depend on each other. If you find yourself in this scenario, your composite alarms stop being evaluated, and you can't delete your composite alarms because they're dependent on each other. The easiest way to break the cycle of dependecy between your composite alarms is to change the function AlarmRule in one of your composite alarms to False. Suppressing composite alarm actions Because composite alarms allow you to get an aggregated view of your health across multiple alarms, there are common situations where it is expected for those alarms to trigger. For example, during a maintenance window of your application or when you investigate an ongoing incident. In such situations, |
acw-ug-167 | acw-ug.pdf | 167 | this scenario, your composite alarms stop being evaluated, and you can't delete your composite alarms because they're dependent on each other. The easiest way to break the cycle of dependecy between your composite alarms is to change the function AlarmRule in one of your composite alarms to False. Suppressing composite alarm actions Because composite alarms allow you to get an aggregated view of your health across multiple alarms, there are common situations where it is expected for those alarms to trigger. For example, during a maintenance window of your application or when you investigate an ongoing incident. In such situations, you may want to suppress the actions of your composite alarms, to prevent unwanted notifications or the creation of new incident tickets With composite alarm action suppression, you define alarms as suppressor alarms. Suppressor alarms prevent composite alarms from taking actions. For example, you can specify a suppressor Suppressing composite alarm actions 465 Amazon CloudWatch User Guide alarm that represents the status of a supporting resource. If the supporting resource is down, the suppressor alarm prevents the composite alarm from sending notifications. Composite alarm action suppression helps you reduce alarm noise, so you spend less time managing your alarms and more time focusing on your operations. You specify suppressor alarms when you configure composite alarms. Any alarm can function as a suppressor alarm. When a suppressor alarm changes states from OK to ALARM, its composite alarm stops taking actions. When a suppressor alarm changes states from ALARM to OK, its composite alarm resumes taking actions. WaitPeriod and ExtensionPeriod When you specify a suppressor alarm, you set the parameters WaitPeriod and ExtensionPeriod. These parameters prevent composite alarms from taking actions unexpectedly while suppressor alarms change states. Use WaitPeriod to compensate for any delays that can occur when a suppressor alarm changes from OK to ALARM. For example, if a suppressor alarm changes from OK to ALARM within 60 seconds, set WaitPeriod to 60 seconds. In the image, the composite alarm changes from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t8. This gives the suppressor alarm time to change states from OK to ALARM at t4 before it suppresses the composite alarm's actions when the WaitPeriod expires at t8. Suppressing composite alarm actions 466 Amazon CloudWatch User Guide Use ExtensionPeriod to compensate for any delays that can occur when a composite alarm changes to OK following a suppressor alarm changing to OK. For example, if a composite alarm changes to OK within 60 seconds of a suppressor alarm changing to OK, set ExtensionPeriod to 60 seconds. In the image, the suppressor alarm changes from ALARM to OK at t2. An ExtensionPeriod starts at t2 and ends at t8. This gives the composite alarm time to change from ALARM to OK before the ExtensionPeriod expires at t8. Composite alarms don't take actions when WaitPeriod and ExtensionPeriod become active. Composite alarms take actions that are based on their currents states when ExtensionPeriod and WaitPeriod become inactive. We recommend that you set the value for each parameter to 60 seconds, as CloudWatch evaluates metric alarms every minute. You can set the parameters to any integer in seconds. The following examples describe in more detail how WaitPeriod and ExtensionPeriod prevent composite alarms from taking actions unexpectedly. Suppressing composite alarm actions 467 Amazon CloudWatch Note User Guide In the following examples, WaitPeriod is configured as 2 time units, and ExtensionPeriod is configured as 3 time units. Examples Example 1: Actions are not suppressed after WaitPeriod In the image, the composite alarm changes states from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t4, so it can prevent the composite alarm from taking actions. After the WaitPeriod expires at t4, the composite alarm takes its actions because the suppressor alarm is still in OK. Example 2: Actions are suppressed by alarm before WaitPeriod expires Suppressing composite alarm actions 468 Amazon CloudWatch User Guide In the image, the composite alarm changes states from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t4. This gives the suppressor alarm time to change states from OK to ALARM at t3. Because the suppressor alarm changes states from OK to ALARM at t3, the WaitPeriod that started at t2 is discarded, and the suppressor alarm now stops the composite alarm from taking actions. Example 3: State transition when actions are suppressed by WaitPeriod Suppressing composite alarm actions 469 Amazon CloudWatch User Guide In the image, the composite alarm changes states from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t4. This gives the suppressor alarm time to change states. The composite alarm changes back to OK at t3, so the WaitPeriod that started at t2 is discarded. A new WaitPeriod starts at |
acw-ug-168 | acw-ug.pdf | 168 | from OK to ALARM at t3, the WaitPeriod that started at t2 is discarded, and the suppressor alarm now stops the composite alarm from taking actions. Example 3: State transition when actions are suppressed by WaitPeriod Suppressing composite alarm actions 469 Amazon CloudWatch User Guide In the image, the composite alarm changes states from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t4. This gives the suppressor alarm time to change states. The composite alarm changes back to OK at t3, so the WaitPeriod that started at t2 is discarded. A new WaitPeriod starts at t3 and ends at t5. After the new WaitPeriod expires at t5, the composite alarm takes its actions. Example 4: State transition when actions are suppressed by alarm Suppressing composite alarm actions 470 Amazon CloudWatch User Guide In the image, the composite alarm changes states from OK to ALARM at t2. The suppressor alarm is already in ALARM. The suppressor alarm stops the composite alarm from taking actions. Example 5: Actions are not suppressed after ExtensionPeriod Suppressing composite alarm actions 471 Amazon CloudWatch User Guide In the image, the composite alarm changes states from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t4. This gives the suppressor alarm time to change states from OK to ALARM at t3 before it suppresses the composite alarm's actions until t6. Because the suppressor alarm changes states from OK to ALARM at t3, the WaitPeriod that started at t2 is discarded. At t6, the suppressor alarm changes to OK. An ExtensionPeriod starts at t6 and ends at t9. After the ExtensionPeriod expires, the composite alarm takes its actions. Example 6: State transition when actions are suppressed by ExtensionPeriod Suppressing composite alarm actions 472 Amazon CloudWatch User Guide In the image, the composite alarm changes states from OK to ALARM at t2. A WaitPeriod starts at t2 and ends at t4. This gives the suppressor alarm time to change states from OK to ALARM at t3 before it suppresses the composite alarm's actions until t6. Because the suppressor alarm changes states from OK to ALARM at t3, the WaitPeriod that started at t2 is discarded. At t6, the suppressor alarm changes back to OK. An ExtensionPeriod starts at t6 and ends at t9. When the composite alarm changes back to OK at t7, the ExtensionPeriod is discarded, and a new WaitPeriod starts at t7 and ends at t9. Tip If you replace the action suppressor alarm, any active WaitPeriod or ExtensionPeriod is discarded. Acting on alarm changes CloudWatch can notify users on two types of alarm changes: when an alarm changes state, and when the configuration of an alarm gets updated. Acting on alarm changes 473 Amazon CloudWatch User Guide When an alarm evaluates, it might change from one state to another, such as ALARM, OK or INSUFFICIENT_DATA. These alarm state changes can signal a possible incident, a return to normal, or a metric being unavailable. In such cases, you might want to the alarm to automatically take one of the following actions • Send a notification to a SNS topic as part of the alarm’s actions. An SNS topic can then be configured for application-to-application (A2A) messaging as well as application-to-person (A2P) notifications, including channels such as email notifications and SMS. All the destinations that you define for your SNS topic receive the alarm notification. For more information, see Amazon SNS event destinations. • You can configure notifications for alarm state change events. AWS User Notifications offers a native way to configure such notifications and is the recommended approach. • Reboot, stop, recover, or terminate an Amazon EC2 instance. For more information, see Create alarms to stop, terminate, reboot, or recover an EC2 instance. • Scale the capacity of an Amazon EC2 Auto Scaling group. For more information, see Step and simple scaling policies for Amazon EC2 Auto Scaling. • Start an investigation in Amazon Q operational investigations. For more information, see Start an investigation in Amazon Q operational investigations from an alarm • Invoke a Lambda function. • Create an incident in Systems Manager Incident Manager. For more information, see Creating incidents automatically with CloudWatch alarms. • Create an OpsItem in Systems Manager OpsCenter. For more information, see Configure CloudWatch alarms to create OpsItems. Additionally, CloudWatch sends events to Amazon EventBridge whenever alarms change state, and when alarms are created, deleted, or updated. You can write EventBridge rules to take actions or be notified when EventBridge receives these events. Topics • Notifying users on alarm changes • Alarm events and EventBridge Acting on alarm changes 474 Amazon CloudWatch User Guide Notifying users on alarm changes This section explains how you can use AWS User Notifications or Amazon Simple Notification Service to have users be notified of alarm changes. |
acw-ug-169 | acw-ug.pdf | 169 | an OpsItem in Systems Manager OpsCenter. For more information, see Configure CloudWatch alarms to create OpsItems. Additionally, CloudWatch sends events to Amazon EventBridge whenever alarms change state, and when alarms are created, deleted, or updated. You can write EventBridge rules to take actions or be notified when EventBridge receives these events. Topics • Notifying users on alarm changes • Alarm events and EventBridge Acting on alarm changes 474 Amazon CloudWatch User Guide Notifying users on alarm changes This section explains how you can use AWS User Notifications or Amazon Simple Notification Service to have users be notified of alarm changes. Setting up AWS User Notifications You can use AWS User Notifications to set up delivery channels to get notified about CloudWatch alarm state change and configuration change events. You receive a notification when an event matches a rule that you specify. You can receive notifications for events through multiple channels, including email, AWS Chatbot chat notifications, or AWS Console Mobile Application push notifications. You can also see notifications in the at Console Notifications Center. User Notifications supports aggregation, which can reduce the number of notifications you receive during specific events. The notification configurations you create with AWS User Notifications do not count towards the limit on the number of actions you can configure per target alarm state. As AWS User Notifications matches the events emitted to Amazon EventBridge, it sends notifications for all the alarms in your account and selected Regions, unless you specify an advanced filter to allowlist or denylist specific alarms or patterns. The following example of an advanced filter matches an alarm state change from OK to ALARM on the alarm named ServerCpuTooHigh. { "detail": { "alarmName": ["ServerCpuTooHigh"], "previousState": { "value": ["OK"] }, "state": { "value": ["ALARM"] } } } You can use any of the properties published by an alarm in EventBridge events to create a filter. For more information, see Alarm events and EventBridge. Setting up Amazon SNS notifications You can use Amazon Simple Notification Service to send both application-to-application (A2A) messaging and application-to-person (A2P) messaging, including mobile text messaging (SMS) and email messages. For more information, see Amazon SNS event destinations. Notifying users on alarm changes 475 Amazon CloudWatch User Guide For every state that an alarm can take, you can configure the alarm to send a message to an SNS topic. Every Amazon SNS topic you configure for a state on a given alarm counts towards the limit on the number of actions you can configure for that alarm and state. You can send messages to the same Amazon SNS topic from any alarms in your account, and use the same Amazon SNS topic for both application (A2A) and person (A2P) consumers. Because this configuration is done at the alarm level, only the alarms you have configured send messages to the selected Amazon SNS topic. First, create a topic, then subscribe to it. You can optionally publish a test message to the topic. For an example, see Setting up an Amazon SNS topic using the AWS Management Console. Or for more information, see Getting started with Amazon SNS. Alternatively, if you plan to use the AWS Management Console to create your CloudWatch alarm, you can skip this procedure because you can create the topic when you create the alarm. When you create a CloudWatch alarm, you can add actions for any target state the alarm enters. Add an Amazon SNS notification for the state you want to be notified about, and select the Amazon SNS topic you created in the previous step to send an email notification when the alarm enters the selected state. Note When you create an Amazon SNS topic, you choose to make it a standard topic or a FIFO topic. CloudWatch guarantees the publication of all alarm notifications to both types of topics. However, even if you use a FIFO topic, in rare cases CloudWatch sends the notifications to the topic out of order. If you use a FIFO topic, the alarm sets the message group ID of the alarm notifications to be a hash of the ARN of the alarm. Topics • Preventing confused deputy security issues • Setting up an Amazon SNS topic using the AWS Management Console • Setting up an SNS topic using the AWS CLI Preventing confused deputy security issues The confused deputy problem is a security issue where an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform the action. In AWS, cross-service impersonation can result in the confused deputy problem. Cross-service impersonation can occur Notifying users on alarm changes 476 Amazon CloudWatch User Guide when one service (the calling service) calls another service (the called service). The calling service can be manipulated to use its permissions to act on another customer's resources in a way |
acw-ug-170 | acw-ug.pdf | 170 | Console • Setting up an SNS topic using the AWS CLI Preventing confused deputy security issues The confused deputy problem is a security issue where an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform the action. In AWS, cross-service impersonation can result in the confused deputy problem. Cross-service impersonation can occur Notifying users on alarm changes 476 Amazon CloudWatch User Guide when one service (the calling service) calls another service (the called service). The calling service can be manipulated to use its permissions to act on another customer's resources in a way it should not otherwise have permission to access. To prevent this, AWS provides tools that help you protect your data for all services with service principals that have been given access to resources in your account. We recommend using the aws:SourceArn, aws:SourceAccount, aws:SourceOrgID, and aws:SourceOrgPaths global condition context keys in resource policies to limit the permissions that Amazon SNS gives another service to the resource. Use aws:SourceArn to associate only one resource with cross-service access. Use aws:SourceAccount to let any resource in that account be associated with the cross-service use. Use aws:SourceOrgID to allow any resource from any account within an organization be associated with the cross-service use. Use aws:SourceOrgPaths to associate any resource from accounts within an AWS Organizations path with the cross-service use. For more information about using and understanding paths, see aws:SourceOrgPaths in the IAM User Guide. The most effective way to protect against the confused deputy problem is to use the aws:SourceArn global condition context key with the full ARN of the resource. If you don't know the full ARN of the resource or if you are specifying multiple resources, use the aws:SourceArn global context condition key with wildcard characters (*) for the unknown portions of the ARN. For example, arn:aws:servicename:*:123456789012:*. If the aws:SourceArn value does not contain the account ID, such as an Amazon S3 bucket ARN, you must use both aws:SourceAccount and aws:SourceArn to limit permissions. To protect against the confused deputy problem at scale, use the aws:SourceOrgID or aws:SourceOrgPaths global condition context key with the organization ID or organization path of the resource in your resource-based policies. Policies that include the aws:SourceOrgID or aws:SourceOrgPaths key will automatically include the correct accounts and you don't have to manually update the policies when you add, remove, or move accounts in your organization. The value of aws:SourceArn must be the ARN of the alarm that is sending notifications. The following example shows how you can use the aws:SourceArn and aws:SourceAccount global condition context keys in CloudWatch to prevent the confused deputy problem. { "Statement": [{ "Effect": "Allow", Notifying users on alarm changes 477 Amazon CloudWatch "Principal": { "Service": "cloudwatch.amazonaws.com" }, "Action": "SNS:Publish", "Resource": "arn:aws:sns:us-east-2:444455556666:MyTopic", "Condition": { "ArnLike": { User Guide "aws:SourceArn": "arn:aws:cloudwatch:us-east-2:111122223333:alarm:*" }, "StringEquals": { "aws:SourceAccount": "111122223333" } } }] } If an alarm ARN includes any non-ASCII characters, use only the aws:SourceAccount global condition key to limit the permissions. Setting up an Amazon SNS topic using the AWS Management Console First, create a topic, then subscribe to it. You can optionally publish a test message to the topic. To create an SNS topic 1. Open the Amazon SNS console at https://console.aws.amazon.com/sns/v3/home. 2. On the Amazon SNS dashboard, under Common actions, choose Create Topic. 3. In the Create new topic dialog box, for Topic name, enter a name for the topic (for example, my-topic). 4. Choose Create topic. 5. Copy the Topic ARN for the next task (for example, arn:aws:sns:us-east-1:111122223333:my- topic). To subscribe to an SNS topic 1. Open the Amazon SNS console at https://console.aws.amazon.com/sns/v3/home. 2. 3. In the navigation pane, choose Subscriptions, Create subscription. In the Create subscription dialog box, for Topic ARN, paste the topic ARN that you created in the previous task. Notifying users on alarm changes 478 Amazon CloudWatch User Guide 4. 5. For Protocol, choose Email. For Endpoint, enter an email address that you can use to receive the notification, and then choose Create subscription. 6. From your email application, open the message from AWS Notifications and confirm your subscription. Your web browser displays a confirmation response from Amazon SNS. To publish a test message to an SNS topic 1. Open the Amazon SNS console at https://console.aws.amazon.com/sns/v3/home. 2. In the navigation pane, choose Topics. 3. On the Topics page, select a topic and choose Publish to topic. 4. In the Publish a message page, for Subject, enter a subject line for your message, and for Message, enter a brief message. 5. Choose Publish Message. 6. Check your email to confirm that you received the message. Setting up an SNS topic using the AWS CLI First, you create an SNS topic, and then you publish a message directly to the topic to test that you have properly configured it. To set up |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.