id
stringlengths 8
78
| source
stringclasses 743
values | chunk_id
int64 1
5.05k
| text
stringlengths 593
49.7k
|
---|---|---|---|
acw-api-065 | acw-api.pdf | 65 | an Alarm Status Widget Object API Version 2010-08-01 297 Amazon CloudWatch Type: String Required: No API Reference The following example is an alarm status widget that displays four alarms specified by name, no matter their current state: { "type": "alarm", "x": 0, "y": 0, "width": 12, "height": 6, "properties": { "alarms": [ "arn:aws:cloudwatch:us-east-1:012345678901:alarm:EC2FrontendCPU", "arn:aws:cloudwatch:us-east-1:012345678901:alarm:EC2BackendCPU", "arn:aws:cloudwatch:eu-west-1:987654321098:alarm:EC2FrontendCPU", "arn:aws:cloudwatch:eu-west-1:987654321098:alarm:EC2BackendCPU" ], "sortBy": "stateUpdatedTimestamp", "title": "All EC2 CPU alarms" } } The following example widget specifies the same four alarms, but the widget displays only the alarms that are currently in ALARM or INSUFFICIENT_DATA state: { "type": "alarm", "x": 0, "y": 0, "width": 12, "height": 6, "properties": { "alarms": [ "arn:aws:cloudwatch:us-east-1:012345678901:alarm:EC2FrontendCPU", "arn:aws:cloudwatch:us-east-1:012345678901:alarm:EC2BackendCPU", "arn:aws:cloudwatch:eu-west-1:987654321098:alarm:EC2FrontendCPU", "arn:aws:cloudwatch:eu-west-1:987654321098:alarm:EC2BackendCPU" ], "sortBy": "stateUpdatedTimestamp", Properties of an Alarm Status Widget Object API Version 2010-08-01 298 Amazon CloudWatch API Reference "states": [ "ALARM", "INSUFFICIENT_DATA" ], "title": "EC2 alarms that are not currently OK" } } Properties of an Alarm Status Widget Object API Version 2010-08-01 299 Amazon CloudWatch API Reference GetMetricWidgetImage: Metric Widget Structure and Syntax MetricWidget is an input parameter for the https://docs.aws.amazon.com/AmazonCloudWatch/ latest/APIReference/API_GetMetricWidgetImage.html API. It is a string in JSON format. Contents • Overall Structure • Format for Each Metric in the Array of Metrics • Annotation Properties Format • yAxis Properties Format Overall Structure The MetricWidget string can include the following parameters: metrics The metrics to include in the graph, as a metrics array. This can include both raw metric and metric math expressions. One metrics array can include 1–100 metrics and expressions. For more information about the format of metrics, see Format for Each Metric in the Array of Metrics. Type: Array of arrays Required: Yes. annotations The horizontal and vertical annotations to add to the graph, as annotations arrays. For more information about the format, see Annotation Properties Format. Required: No end The date and time for the end of the metrics shown in the graph. This can be expressed as either an absolute value, such as 2018-04-25T12:00:00.000Z or a relative value such as -PID. Overall Structure API Version 2010-08-01 300 Amazon CloudWatch API Reference If you don't specify end, the default of -PT0H (the current time) is used. Type: String Required: No height The height of the widget in pixels. The default is 400. Valid Values: 1–2000 Type: Integer Required: No, but you should set this if you also set a value for width. legend Specifies the location and visibility of the graph legend. legend contains one field, position. The value of position can be bottom, right, or hidden. The default is bottom. Type: String Required: No liveData Specify true to display live data in the widget. Live data is data published within the last minute that has not been fully aggregated. For more information, see Use Live Data. Type: Boolean Required: No period The default period, in seconds, for all metrics in this widget. This default can be overridden within each metric definition. The default is 300. Valid Values: 1, 5, 10, 30, 60, and any multiple of 60. 1, 5, 10, and 30 are only for high- resolution metrics. Type: Integer Overall Structure API Version 2010-08-01 301 Amazon CloudWatch Required: No region API Reference This parameter is optional. If you include it, it must specify the local Region. Type: String Required: No stacked Specify true to display the graph as a stacked line, or false to display as separate lines. The default is false. Type: Boolean Required: No start The date and time for the start of the metrics shown in the graph. This can be expressed as either an absolute value, such as 2018-04-25T12:00:00.000Z or a relative value such as -PID. If you don't specify start, the default of -PT3H (three hours ago) is used. Type: String Required: No stat The default statistic to be displayed for each metric in the array. This default can be overridden within the definition of each individual metric in the metrics array. If you omit this, the default of Average is used. Valid Values: SampleCount | Average | Sum | Minimum | Maximum | p?? | TM(??:??), TC(??:??) | TS(??:??) | WM(??:??) | PR(??:??) | IQM Type: String that is a valid CloudWatch statistic. Required: No Overall Structure API Version 2010-08-01 302 Amazon CloudWatch theme API Reference The color palette used to style the graph. The default is light. Valid Values: light | dark Type: String Required: No timezone The time zone to use for displaying the times in the graph. The format is + or - followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time 1 hour and 30 minutes ahead of UTC. The default is +0000. Type: String Required: No title The title to be displayed for the graph. Type: String |
acw-api-066 | acw-api.pdf | 66 | color palette used to style the graph. The default is light. Valid Values: light | dark Type: String Required: No timezone The time zone to use for displaying the times in the graph. The format is + or - followed by four digits. The first two digits indicate the number of hours ahead or behind of UTC, and the final two digits are the number of minutes. For example, +0130 indicates a time 1 hour and 30 minutes ahead of UTC. The default is +0000. Type: String Required: No title The title to be displayed for the graph. Type: String Required: No view The display format. Specify timeSeries to display this metric as a line graph. Specify bar to display the metric as a bar graph. Specify pie to display the metric as a pie graph. The default is timeSeries. Valid Values: timeSeries | bar | pie Type: String Required: No width The width of the widget in pixels. The default is 600. Overall Structure API Version 2010-08-01 303 Amazon CloudWatch Valid Values: 1–2000 Type: Integer API Reference Required: No, but you should set this if you also set a value for width. yAxis Limits for the minimums and maximums of the y-axis. This applies to every metric being graphed, unless specific metrics override it. For more information about the format, see yAxis Properties Format. Type: YAxis object Required: No Format for Each Metric in the Array of Metrics Each item in the metrics array is a CloudWatch metric to display in the graph, or to use as part of a math expression displayed in the graph. For more information about math expressions, see Use Metric Math in the Amazon CloudWatch User Guide. Each metric in the array has the following format: [Namespace, MetricName, Dimension1Name, Dimension1Value, Dimension2Name, Dimension2Value... {Options Object}] Namespace The AWS namespace containing the metric. To use the same namespace as the previous metric in the array, you may specify "." for each entry after the first. Type: String Required: Yes MetricName The name of the CloudWatch metric. To use the same name as the previous metric in the array, you may specify "." for each entry after the first. Type: String Format for Each Metric in the Array of Metrics API Version 2010-08-01 304 Amazon CloudWatch Required: Yes DimensionName API Reference The name of a dimension to further refine what data is shown. To use the same dimension name as the previous metric in the array, you may specify "." for each entry after the first. You may specify zero dimensions for a metric, or up to as many dimensions as the metric supports. Type: String Required: No DimensionValue The value to use for that dimension for the metric. Required if there is a corresponding dimension name. Type: String Required: No, unless there is a corresponding dimension name. Options Object Specifies either custom rendering properties to be used for the specified CloudWatch metric, or a math expression to display on the graph. For more information about the format, see Options Object Format. Type: Options Object Required: No Examples // The simplest example, a metric with no dimensions [ "AWS/EC2", "CPUUtilization" ] // A metric with a single dimension [ "AWS/EC2", "CPUUtilization", "InstanceId", "i-01234567890123456" ] // A metric with a single dimension and rendering properties [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-01234567890123456", { yAxis: "right"} ] Format for Each Metric in the Array of Metrics API Version 2010-08-01 305 Amazon CloudWatch API Reference // The following example graphs the DiskReadBytes metric for three instances. [ "AWS/EC2", "DiskReadBytes", "InstanceId", "i-01234567890123456" ], [ ".", ".", ".", "i-abc" ], [ ".", ".", ".", "i-123" ] Options Object Format Specifies either custom rendering properties to be used for the specified CloudWatch metric, or a math expression to display on the graph. If this object is specified as part of a CloudWatch metric in the metrics array, it sets custom rendering properties for this metric and overrides the defaults used for the whole graph. You can also specify this object to add a math expression to the graph. In this case, the other settings in this object specify the display options for the result of the math expression. This section describes the format of these options objects. color The six-digit HTML hex color code to be used for this metric or expression. Type: String Required: No expression A math expression to display. For more information about supported math expression functions and format, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide. Type: String that is a valid CloudWatch metric math expression. Required: Yes if this is an expression. label The label to display for this metric or expression in the graph legend. If this is not specified, the metric is given an auto-generated label that distinguishes it from the other metrics in |
acw-api-067 | acw-api.pdf | 67 | options objects. color The six-digit HTML hex color code to be used for this metric or expression. Type: String Required: No expression A math expression to display. For more information about supported math expression functions and format, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide. Type: String that is a valid CloudWatch metric math expression. Required: Yes if this is an expression. label The label to display for this metric or expression in the graph legend. If this is not specified, the metric is given an auto-generated label that distinguishes it from the other metrics in the widget. Type: String Options Object Format API Version 2010-08-01 306 Amazon CloudWatch Required: No id API Reference An identifier for this metric or expression, which must be unique within this widget. The id can be used as a variable to represent this metric or expression within math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter. Type: String Required: No period The period for this metric, in seconds. If specified, this overrides the default period used for other metrics in this graph. This parameter is not applicable for math expressions. Valid Values: 1, 5, 10, 30, 60, and any multiple of 60. 1, 5, 10, and 30 are only for high- resolution metrics. Type: Integer Required: No stat The statistic to be displayed for this metric, if it is to be different than the statistic used for the other metrics in the graph. This parameter is not applicable for math expressions. Valid Values: SampleCount | Average | Sum | Minimum | Maximum | p?? Type: String that is a valid CloudWatch statistic. Required: No visible Specifies whether this metric or expression is shown on the graph. The default is true. Setting visible to false is useful if you want to hide the raw metrics that are used in math expressions, and show only the expression results on the graph. Type: Boolean Options Object Format API Version 2010-08-01 307 Amazon CloudWatch Required: No yAxis API Reference Where on the graph to display the y-axis for this metric or expression. The default is left. Valid Values: left | right Type: String Required: No Example In the following example, CloudWatch retrieves a custom apiLatency metric. At the top, the p50 statistic is specified to show the median value. Next, for the same metric on the same instance (this is specified by the four fields that are just periods), the Average value is graphed. Next is an options object with a math expression, showing the halfway value of the two metrics. Finally, another expression shows the rate of change. To show only the results of the two expressions on the graph and hide the raw metrics, you could change the first two instances of visible to false. { "metrics": [ [ "MyNamespace", "apiLatency", "InstanceId", "i-0987654321abcdef0", { "id": "m1", "stat": "p50", "label": "Median value", "visible": true, "color": "#dddddd", "yAxis": "left", "period": 300 } ], [ ".", ".", Options Object Format API Version 2010-08-01 308 API Reference Amazon CloudWatch ".", ".", { "id": "m2", "stat": "Average", "label": "Average value", "visible": true, "color": "#cccccc", "yAxis": "left", "period": 300 } ], [ { "expression": "(m1+m2)/2", "id": "e1", "label": "Half way between average and median", "visible": true, "color": "#000000", "yAxis": "left" } ], [ { "expression": "RATE(e1)", "yAxis": "right", "label": "rate of change of the half way point" } ] ] } Annotation Properties Format A single graph can have multiple horizontal and vertical annotations. All horizontal annotations are specified in one horizontal field, and all vertical annotations are specified in one vertical field. horizontal An array of horizontal annotations. Horizontal annotations have several options for fill shading, including shading above the annotation line, shading below the annotation line, and "band" Annotation Properties Format API Version 2010-08-01 309 Amazon CloudWatch API Reference shading that appears between two linked annotation lines as part of a single annotation. Each horizontal annotation in the array that does not have band shading has the following format: {value, label, color, fill, yAxis, visible} Each horizontal annotation that does have band shading has the following format: [{value, label, color, yAxis, visible}, {value, label}] vertical An array of vertical annotations. Vertical annotations have several options for fill shading, including shading before the annotation line, shading after the annotation line, and "band" shading that appears between two linked annotation lines as part of a single band annotation. Each vertical annotation in the array that does not have band shading has the following format: {value, label, color, fill, visible} Each vertical annotation that does have band shading has the following format: [{value, label, color, visible}, {value, label}] The horizontal array can include the following fields. value The metric value in the graph where the horizontal annotation line is to appear. |
acw-api-068 | acw-api.pdf | 68 | vertical annotations. Vertical annotations have several options for fill shading, including shading before the annotation line, shading after the annotation line, and "band" shading that appears between two linked annotation lines as part of a single band annotation. Each vertical annotation in the array that does not have band shading has the following format: {value, label, color, fill, visible} Each vertical annotation that does have band shading has the following format: [{value, label, color, visible}, {value, label}] The horizontal array can include the following fields. value The metric value in the graph where the horizontal annotation line is to appear. On a band shading annotation, the two values for Value define the upper and lower edges of the band. On a graph with horizontal annotations, the graph is scaled so that all visible horizontal annotations appear on the graph. Type: Float Required: Yes, if horizontal annotations are used. label A string that appears on the graph next to the annotation. Annotation Properties Format API Version 2010-08-01 310 Amazon CloudWatch Type: String Required: No color API Reference The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading. Type: String Required: No fill How to use fill shading with the annotation. Valid values are above for shading above the annotation, below for shading below the annotation, and none for no shading. If fill is omitted, there is no shading. The exception is an annotation with band shading. These annotations always have shading between the two values, and any value for fill is ignored. Type: String Required: No visible Set this to true to have the annotation appear in the graph, or false to have it be hidden. The default is true. Type: Boolean Required: No yAxis If the graph includes multiple metrics, specifies whether the numbers in Value refer to the metric associated with the left Y-axis or the right Y-axis. Valid values are right and left. Type: String Required: No The vertical array can include the following fields. Annotation Properties Format API Version 2010-08-01 311 Amazon CloudWatch value API Reference The time stamp where the vertical annotation line is to appear. This must be specified as an absolute time stamp, such as 2018-08-28T15:25:26Z. On a band shading annotation, the two values for Value define the beginning and ending edges of the band. Type: String Required: Yes, if vertical annotations are used. label A descriptive string that appears on the graph next to the annotation. Type: String Required: No color The six-digit HTML hex color code to be used for the annotation. This color is used for both the annotation line and the fill shading. Type: String Required: No fill How to use fill shading with the annotation. Valid values are before for shading before the annotation, after for shading after the annotation, and none for no shading. If fill is omitted, there is no shading. The exception is an annotation with band shading. These annotations always have shading between the two values, and any value for fill is ignored. Type: String Required: No visible Set this to true to have the annotation appear in the graph, or false to have it be hidden. The default is true. Annotation Properties Format API Version 2010-08-01 312 Amazon CloudWatch Type: Boolean Required: No Examples API Reference // A single horizontal annotation with fill shading above the annotation line, based on the metric associated with the right Y-axis "annotations": { "horizontal": [ { "visible":true, "color":"#9467bd", "label":"Critical range", "value":20, "fill":"above", "yAxis":"right" } ] } // A horizontal band annotation. Each value has a label, but other parameters for the band need to be specified only with the first number "annotations": { "horizontal": [ [ { "label":"Band top", "value":200, "color":"#9467bd", "visible":true, "yAxis":"right" }, { "value":95.5, "label":"Band bottom" } ] ] } Annotation Properties Format API Version 2010-08-01 313 Amazon CloudWatch API Reference // A single vertical annotation with fill shading after the annotation line "annotations": { "vertical": [ { "visible": true, "color": "#9467bd", "label": "Bug fix deployed", "value": "2018-08-28T15:25:26Z", "fill": "after" } ] } // A vertical band annotation. Each annotation line has a label, but other parameters for the band are specified only with the first value "annotations": { "vertical": [ [ { "label": "Band start", "value": "2018-08-27T15:25:26Z", "color": "#9467bd", "visible": true }, { "value": "2018-08-28T15:25:26Z", "label": "Band end" } ] ] } Annotation Properties Format API Version 2010-08-01 314 Amazon CloudWatch API Reference yAxis Properties Format Defines the minimum and maximum values for the Y-axis of the graph. Set this within the MetricWidget object to affect all metrics in the widget. To override the widget settings for a particular metric, set it in the options object for that metric in the metrics array. left Optional min and max settings for |
acw-api-069 | acw-api.pdf | 69 | specified only with the first value "annotations": { "vertical": [ [ { "label": "Band start", "value": "2018-08-27T15:25:26Z", "color": "#9467bd", "visible": true }, { "value": "2018-08-28T15:25:26Z", "label": "Band end" } ] ] } Annotation Properties Format API Version 2010-08-01 314 Amazon CloudWatch API Reference yAxis Properties Format Defines the minimum and maximum values for the Y-axis of the graph. Set this within the MetricWidget object to affect all metrics in the widget. To override the widget settings for a particular metric, set it in the options object for that metric in the metrics array. left Optional min and max settings for the left Y-axis. Type: YAxis object Required: No right Optional min and max settings for the right Y-axis. Type: YAxis object Required: No Each of the left and right objects can include the following parameters: min The minimum value for this Y-axis. Type: Float Required: No max The maximum value for this Y-axis. Type: Float Required: No Example { yAxis Properties Format API Version 2010-08-01 315 Amazon CloudWatch left: { min: 0, max: 100 }, right: { min: 0 } } API Reference yAxis Properties Format API Version 2010-08-01 316 Amazon CloudWatch API Reference Making API Requests Query requests used with Amazon CloudWatch are HTTP or HTTPS requests that use the an HTTP verb such as GET or POST, and a Query parameter named Action or Operation. This documentation uses Action, although Operation is supported for backward compatibility. CloudWatch does not care which HTTP verb you use in a request. POST requests, GET requests, PUT requests, DELETE requests and so on all return the same result. Amazon CloudWatch Endpoints An endpoint is a URL that serves as an entry point for a web service. You can select a regional endpoint when you make your requests to reduce latency. For information about the endpoints used with CloudWatch, see Regions and Endpoints in the Amazon Web Services General Reference. Query Parameters Each query request must include some common parameters to handle authentication and selection of an action. For more information, see Common Parameters. Some API operations take lists of parameters. These lists are specified using the following notation: param.member.n. Values of n are integers starting from 1. All lists of parameters must follow this notation, including lists that contain only one parameter. For example, a Query parameter list looks like this: &attribute.member.1=this &attribute.member.2=that Request Identifiers In every response from an AWS Query API, there is a ResponseMetadata element, which contains a RequestId element. This string is a unique identifier that AWS assigns to provide tracking information. Although RequestId is included as part of every response, it is not listed on the individual API documentation pages to improve readability and to reduce redundancy. Amazon CloudWatch Endpoints API Version 2010-08-01 317 Amazon CloudWatch API Reference Query API Authentication You can send query requests over either HTTP or HTTPS. Regardless of which protocol you use, you must include a signature in every query request. For more information about creating and including a signature, see Signing AWS API Requests in the Amazon Web Services General Reference. Available Libraries AWS provides libraries, sample code, tutorials, and other resources for software developers who prefer to build applications using language-specific APIs instead of the command-line tools and Query API. These libraries provide basic functions (not included in the APIs), such as request authentication, request retries, and error handling so that it is easier to get started. Libraries and resources are available for the following languages and platforms: • AWS Mobile SDK for Android • AWS SDK for Go • AWS Mobile SDK for iOS • AWS SDK for Java 2.x • AWS SDK for Java • AWS SDK for JavaScript • AWS SDK for JavaScript in Node.js • AWS SDK for .NET • AWS SDK for PHP • AWS SDK for Python (Boto) • AWS SDK for Ruby For libraries and sample code in all languages, see Sample Code & Libraries. Making API Requests Using the POST Method If you don't use one of the AWS SDKs, you can make CloudWatch API requests over HTTP using the POST request method. The POST method requires you to specify the operation in the header of the request and provide the data for the operation in JSON format in the body of the request. Query API Authentication API Version 2010-08-01 318 Amazon CloudWatch API Reference Header name Header value host The Amazon CloudWatch endpoint. For example, monitoring.us- west-1.amazonaws.com x-amz-date You must provide the time stamp in either the HTTP Date header or the AWS x-amz-date header. Some HTTP client libraries don't let you set the Date header. When an x-amz-date header is present, the system ignores any Date header during the request authentication. The x-amz-date header must be specified in ISO 8601 basic format. For example: 20130315T092054Z Authorization The set of authorization |
acw-api-070 | acw-api.pdf | 70 | for the operation in JSON format in the body of the request. Query API Authentication API Version 2010-08-01 318 Amazon CloudWatch API Reference Header name Header value host The Amazon CloudWatch endpoint. For example, monitoring.us- west-1.amazonaws.com x-amz-date You must provide the time stamp in either the HTTP Date header or the AWS x-amz-date header. Some HTTP client libraries don't let you set the Date header. When an x-amz-date header is present, the system ignores any Date header during the request authentication. The x-amz-date header must be specified in ISO 8601 basic format. For example: 20130315T092054Z Authorization The set of authorization parameters that AWS uses to ensure the validity and authenticity of the request. For more information about constructing this header, see Signature Version 4 Signing Process in the Amazon Web Services General Reference. x-amz-target Specifies the CloudWatch operation: GraniteServiceVersion20100801. API_Name For example, for GetMetricData the target value is the following: GraniteServiceVersion20100801.GetMetricData Content-Type Specifies the input format. The valid value is application/json Accept Specifies the response format. The valid value is application/json Content-length Size of the payload in bytes. Content-Encoding Specifies the encoding format of the input and output. The valid value is amz-1.0 The following is an example header for an HTTP request to return metric data in JSON format: POST / HTTP/1.1 host: monitoring.us-east-1.amazonaws.com Making API Requests Using the POST Method API Version 2010-08-01 319 Amazon CloudWatch API Reference x-amz-target: GraniteServiceVersion20100801.GetMetricData x-amz-date: 20180112T092034Z Authorization: AWS4-HMAC-SHA256 Credential=REDACTEDREDACTED/20180411/ us-east-1/monitoring/aws4_request, SignedHeaders=content- encoding;content-length;content-type;host;x-amz-date;x-amz-target, Signature=e945ed75cb91f88f138445fba02d3af93d96bfd8491e5d03588ae1b65188ff1d Content-Type: application/json Accept: application/json Content-Encoding: amz-1.0 Content-Length: 45 Connection: keep-alive Making API Requests Using the POST Method API Version 2010-08-01 320 Amazon CloudWatch API Reference Common Parameters The following list contains the parameters that all actions use for signing Signature Version 4 requests with a query string. Any action-specific parameters are listed in the topic for that action. For more information about Signature Version 4, see Signing AWS API requests in the IAM User Guide. Action The action to be performed. Type: string Required: Yes Version The API version that the request is written for, expressed in the format YYYY-MM-DD. Type: string Required: Yes X-Amz-Algorithm The hash algorithm that you used to create the request signature. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Valid Values: AWS4-HMAC-SHA256 Required: Conditional X-Amz-Credential The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string ("aws4_request"). The value is expressed in the following format: access_key/YYYYMMDD/region/service/ aws4_request. API Version 2010-08-01 321 Amazon CloudWatch API Reference For more information, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional X-Amz-Date The date that is used to create the signature. The format must be ISO 8601 basic format (YYYYMMDD'T'HHMMSS'Z'). For example, the following date time is a valid X-Amz-Date value: 20120325T120000Z. Condition: X-Amz-Date is optional for all requests; it can be used to override the date used for signing requests. If the Date header is specified in the ISO 8601 basic format, X-Amz-Date is not required. When X-Amz-Date is used, it always overrides the value of the Date header. For more information, see Elements of an AWS API request signature in the IAM User Guide. Type: string Required: Conditional X-Amz-Security-Token The temporary security token that was obtained through a call to AWS Security Token Service (AWS STS). For a list of services that support temporary security credentials from AWS STS, see AWS services that work with IAM in the IAM User Guide. Condition: If you're using temporary security credentials from AWS STS, you must include the security token. Type: string Required: Conditional X-Amz-Signature Specifies the hex-encoded signature that was calculated from the string to sign and the derived signing key. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. API Version 2010-08-01 322 Amazon CloudWatch Type: string Required: Conditional X-Amz-SignedHeaders API Reference Specifies all the HTTP headers that were included as part of the canonical request. For more information about specifying signed headers, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional API Version 2010-08-01 323 Amazon CloudWatch API Reference Common Errors This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The |
acw-api-071 | acw-api.pdf | 71 | more information about specifying signed headers, see Create a signed AWS API request in the IAM User Guide. Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header. Type: string Required: Conditional API Version 2010-08-01 323 Amazon CloudWatch API Reference Common Errors This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this service, see the topic for that API action. AccessDeniedException You do not have sufficient access to perform this action. HTTP Status Code: 400 IncompleteSignature The request signature does not conform to AWS standards. HTTP Status Code: 400 InternalFailure The request processing has failed because of an unknown error, exception or failure. HTTP Status Code: 500 InvalidAction The action or operation requested is invalid. Verify that the action is typed correctly. HTTP Status Code: 400 InvalidClientTokenId The X.509 certificate or AWS access key ID provided does not exist in our records. HTTP Status Code: 403 NotAuthorized You do not have permission to perform this action. HTTP Status Code: 400 OptInRequired The AWS access key ID needs a subscription for the service. HTTP Status Code: 403 API Version 2010-08-01 324 Amazon CloudWatch RequestExpired API Reference The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future. HTTP Status Code: 400 ServiceUnavailable The request has failed due to a temporary failure of the server. HTTP Status Code: 503 ThrottlingException The request was denied due to request throttling. HTTP Status Code: 400 ValidationError The input fails to satisfy the constraints specified by an AWS service. HTTP Status Code: 400 API Version 2010-08-01 325 |
acw-cli-001 | acw-cli.pdf | 1 | Command Line Reference Amazon CloudWatch API Version 2010-08-01 Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon CloudWatch Command Line Reference Amazon CloudWatch: Command Line Reference Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon CloudWatch Table of Contents Command Line Reference Welcome ........................................................................................................................................... 1 Set up the command line interface ............................................................................................... 2 Command line interface reference ................................................................................................. 3 mon-cmd ........................................................................................................................................................ 3 Description ................................................................................................................................................ 3 Syntax ........................................................................................................................................................ 4 Output ....................................................................................................................................................... 4 Examples ................................................................................................................................................... 4 Related Topics .......................................................................................................................................... 5 mon-delete-alarms ....................................................................................................................................... 5 Description ................................................................................................................................................ 5 Syntax ........................................................................................................................................................ 5 Options ...................................................................................................................................................... 5 Common options ..................................................................................................................................... 6 Output ..................................................................................................................................................... 11 Examples ................................................................................................................................................. 11 Related topics ........................................................................................................................................ 11 mon-describe-alarm-history .................................................................................................................... 12 Description .............................................................................................................................................. 12 Syntax ...................................................................................................................................................... 12 Options .................................................................................................................................................... 12 Common options .................................................................................................................................. 13 Output ..................................................................................................................................................... 18 Examples ................................................................................................................................................. 19 Related topics ........................................................................................................................................ 19 mon-describe-alarms ................................................................................................................................. 20 Description .............................................................................................................................................. 20 Syntax ...................................................................................................................................................... 20 Options .................................................................................................................................................... 20 Common options .................................................................................................................................. 21 Output ..................................................................................................................................................... 26 Examples ................................................................................................................................................. 27 Related topics ........................................................................................................................................ 28 mon-describe-alarms-for-metric ............................................................................................................. 28 API Version 2010-08-01 iii Amazon CloudWatch Command Line Reference Description .............................................................................................................................................. 28 Syntax ...................................................................................................................................................... 28 Options .................................................................................................................................................... 29 Common options .................................................................................................................................. 33 Output ..................................................................................................................................................... 38 Examples ................................................................................................................................................. 39 Related topics ........................................................................................................................................ 39 mon-disable-alarm-actions ...................................................................................................................... 39 Description .............................................................................................................................................. 39 Syntax ...................................................................................................................................................... 40 Options .................................................................................................................................................... 40 Common options .................................................................................................................................. 40 Output ..................................................................................................................................................... 45 Examples ................................................................................................................................................. 46 Related topics ........................................................................................................................................ 46 mon-enable-alarm-actions ....................................................................................................................... 46 Description .............................................................................................................................................. 46 Syntax ...................................................................................................................................................... 46 Options .................................................................................................................................................... 47 Common options .................................................................................................................................. 47 Output ..................................................................................................................................................... 52 Examples ................................................................................................................................................. 52 Related topics ........................................................................................................................................ 52 mon-get-stats .............................................................................................................................................. 52 Description .............................................................................................................................................. 52 Syntax ...................................................................................................................................................... 53 Options .................................................................................................................................................... 53 Common options .................................................................................................................................. 58 Output ..................................................................................................................................................... 63 Examples ................................................................................................................................................. 63 Related topics ........................................................................................................................................ 64 mon-list-metrics ......................................................................................................................................... 65 Description .............................................................................................................................................. 65 Syntax ...................................................................................................................................................... 65 Options .................................................................................................................................................... 65 Common options .................................................................................................................................. 67 API Version 2010-08-01 iv Amazon CloudWatch Command Line Reference Output ..................................................................................................................................................... 72 Examples ................................................................................................................................................. 72 Related topics ........................................................................................................................................ 73 mon-put-data .............................................................................................................................................. 73 Description .............................................................................................................................................. 73 Syntax ...................................................................................................................................................... 74 Options .................................................................................................................................................... 74 Common options .................................................................................................................................. 78 Output ..................................................................................................................................................... 83 Examples ................................................................................................................................................. 84 Related topics ........................................................................................................................................ 84 mon-put-metric-alarm .............................................................................................................................. 85 Description .............................................................................................................................................. 85 Syntax ...................................................................................................................................................... 85 Options .................................................................................................................................................... 85 Common options .................................................................................................................................. 94 Output ..................................................................................................................................................... 99 Examples ............................................................................................................................................... 100 Related topics ...................................................................................................................................... 100 mon-set-alarm-state ............................................................................................................................... 100 Description ........................................................................................................................................... 100 Syntax .................................................................................................................................................... 101 Options ................................................................................................................................................. 101 Common options ................................................................................................................................ 102 Output ................................................................................................................................................... 107 Examples ............................................................................................................................................... 107 Related topics ...................................................................................................................................... 107 mon-version .............................................................................................................................................. 107 Description ........................................................................................................................................... 107 Syntax .................................................................................................................................................... 107 Output ................................................................................................................................................... 108 Examples ............................................................................................................................................... 108 Related topics ...................................................................................................................................... 108 Document history ........................................................................................................................ 109 API Version 2010-08-01 v Amazon CloudWatch Welcome Command Line Reference As of November 7, 2017, we are no longer supporting the CloudWatch command line interface with new functionality. It is not available for download. The CloudWatch CLI reference documentation is still available. We encourage customers to use the AWS Command Line Interface. The AWS CLI includes all existing and new CloudWatch commands, and is the only command line interface being updated. For information about installing the AWS CLI, see Installing the AWS Command Line Interface. For information about CloudWatch commands in the AWS CLI, see cloudwatch. API Version 2010-08-01 1 Amazon CloudWatch Command Line Reference Set up the command line interface As of November 7, 2017, we are no longer supporting the CloudWatch command line interface with new functionality. It is not available for download. The CloudWatch CLI reference documentation is still available. We encourage customers to use the AWS Command Line Interface. The AWS CLI includes all existing and new CloudWatch commands, and is the only command line interface being updated. For information about installing the AWS CLI, see Installing the AWS Command Line Interface. For information about CloudWatch commands in the AWS CLI, see cloudwatch. API Version 2010-08-01 2 Amazon CloudWatch Command Line Reference Amazon CloudWatch command line interface reference AWS provides two sets of command line tools that each support CloudWatch. This section describes the CloudWatch command line interface (CLI). As of November 7, 2017, we are no longer supporting this CloudWatch command line interface with new functionality and it is no longer available for download. We encourage customers to use the AWS Command Line Interface to control and automate CloudWatch on Windows, Mac, and Linux. We also offer the AWS Tools for Windows PowerShell if you prefer to script in the PowerShell environment. Commands • mon-cmd • mon-delete-alarms • mon-describe-alarm-history • mon-describe-alarms • mon-describe-alarms-for-metric • mon-disable-alarm-actions • mon-enable-alarm-actions • mon-get-stats • mon-list-metrics • |
acw-cli-002 | acw-cli.pdf | 2 | command line tools that each support CloudWatch. This section describes the CloudWatch command line interface (CLI). As of November 7, 2017, we are no longer supporting this CloudWatch command line interface with new functionality and it is no longer available for download. We encourage customers to use the AWS Command Line Interface to control and automate CloudWatch on Windows, Mac, and Linux. We also offer the AWS Tools for Windows PowerShell if you prefer to script in the PowerShell environment. Commands • mon-cmd • mon-delete-alarms • mon-describe-alarm-history • mon-describe-alarms • mon-describe-alarms-for-metric • mon-disable-alarm-actions • mon-enable-alarm-actions • mon-get-stats • mon-list-metrics • mon-put-data • mon-put-metric-alarm • mon-set-alarm-state • mon-version mon-cmd Description Lists all the other CloudWatch commands. For help on a specific command, use the following command: commandname --help mon-cmd API Version 2010-08-01 3 Amazon CloudWatch Syntax mon-cmd Output Command Line Reference This command lists all of the Amazon CloudWatch commands in a table. The Amazon CloudWatch CLI displays errors on stderr. Examples Example Request This example lists all of the Amazon CloudWatch commands. mon-cmd Command Name Description ------------ ----------- help mon-delete-alarms Delete alarms. mon-describe-alarm-history Show the history of alarm transitions and actions taken. mon-describe-alarms List alarms and show detailed alarm configuration. mon-describe-alarms-for-metric Show alarms for a given metric. mon-disable-alarm-actions Disable all actions for a given alarm. mon-enable-alarm-actions Enable all actions for a given alarm. mon-get-stats Get metric statistics. mon-list-metrics List user's metrics. mon-put-data Put metric data. mon-put-metric-alarm Create a new alarm or update an existing one. mon-set-alarm-state Manually set the state of an alarm. mon-version Prints the version of the CLI tool and API. Syntax API Version 2010-08-01 4 Amazon CloudWatch Command Line Reference For help on a specific command, type '<commandname> --help' Related Topics Download • Set up the command line interface Related Command • mon-version Command mon-delete-alarms Description Deletes the specified alarms. Syntax mon-delete-alarms [AlarmNames [AlarmNames ...]] [Common Options] Options Name Description AlarmNames AlarmNames The names of the alarms to delete, separated by a space. You can also set this value using --alarm-n ame . Type: Argument Valid values: The name of the alarm, which must between 1 and 255 characters in length. Default: n/a Required: Yes Related Topics API Version 2010-08-01 5 Amazon CloudWatch Name -f, --force Command Line Reference Description Deletes the alarms without prompting you for confirmation. By default, the mon-delete-alarms command prompts you for confirmation before deleting alarms. Type: Flag Valid values: n/a Default: You are prompted before deleting each alarm. Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Common options API Version 2010-08-01 6 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API Version 2010-08-01 7 Amazon CloudWatch Name Description Command Line Reference -I, --access-key-id VALUE The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt |
acw-cli-003 | acw-cli.pdf | 3 | to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None Common options API Version 2010-08-01 8 Amazon CloudWatch Name Description Command Line Reference --region VALUE The region requests are directed to. You can use the S, --secret-key VALUE environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. Common options API Version 2010-08-01 9 Amazon CloudWatch Name Description Command Line Reference --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 10 Command Line Reference Amazon CloudWatch Output This command deletes an alarm. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example deletes the alarm named my-alarm. mon-delete-alarms --alarm-name my-alarm Example request This example deletes multiple alarms. mon-delete-alarms --alarm-name my-alarm1 my-alarm2 my-alarm3 Related topics Download • Set up the command line interface Related action • DeleteAlarms Related commands • mon-put-metric-alarm • mon-disable-alarm-actions • mon-enable-alarm-actions Output API Version 2010-08-01 11 Amazon CloudWatch Command Line Reference mon-describe-alarm-history Description Retrieves the history for the specified alarm. You can filter alarms by date range or item type. If you don't specify an alarm name, Amazon CloudWatch returns histories for all of your alarms. Note Amazon CloudWatch retains the history of active and deleted alarms for two weeks. Syntax mon-describe-alarm-history [AlarmNames [AlarmNames ...]] [--end-date value] [--history-item-type value] [--start-date value] [Common Options] Options Name AlarmName AlarmNames Description The names of the alarms, separated by spaces. If you don't specify an alarm name, this command returns the histories of all your alarms. You can also set this value using --alarm-name . Type: Argument Valid values: Any string between 1 and 255 characters in length. Default: n/a Required: No --end-date VALUE The end of the date range for history. Type: Date Valid values: Date in YYYY-MM-DD format. mon-describe-alarm-history API Version 2010-08-01 12 Amazon CloudWatch Name Command Line Reference Description Default: The current date. Required: No --history-item-type VALUE The type of history items to retrieve. By default, all types are returned. Type: Enumeration Valid values: ConfigurationUpdate, StateUpdate, or Action Default: All types are returned. Required: No --start-date VALUE The start of the date range for history. By default it extends to all available history. Type: Date Valid values: Date in YYYY-MM-DD format. Default: All available history. Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the credential file, the file |
acw-cli-004 | acw-cli.pdf | 4 | VALUE The type of history items to retrieve. By default, all types are returned. Type: Enumeration Valid values: ConfigurationUpdate, StateUpdate, or Action Default: All types are returned. Required: No --start-date VALUE The start of the date range for history. By default it extends to all available history. Type: Date Valid values: Date in YYYY-MM-DD format. Default: All available history. Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the credential file, the file must exist or the request fails. . If you define the All CloudWatch requests must be signed using your access key ID and secret access key. Common options API Version 2010-08-01 13 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. Type: String Valid values: Any string. Default: Comma (,) Common options API Version 2010-08-01 14 Amazon CloudWatch Name --headers -I, --access-key-id VALUE Command Line Reference Description If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 15 Amazon CloudWatch Name Description Command Line Reference -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None --region VALUE The region requests are directed to. You can use the environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. Common options API Version 2010-08-01 16 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false Common options API Version 2010-08-01 17 Amazon CloudWatch Name Description Command Line Reference --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. |
acw-cli-005 | acw-cli.pdf | 5 | output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Output This command returns a table that contains the following: • ALARM - The alarm name. • TIMESTAMP - The timestamp. • TYPE - The type of event, one of ConfigurationUpdate, StateUpdate and Action. Output API Version 2010-08-01 18 Amazon CloudWatch Command Line Reference • SUMMARY - A human-readable summary of history event. • DATA - Detailed data about the event in machine-readable JSON format. This column appears only in the --show-long view. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example describes all history items for the alarm my-alarm. mon-describe-alarm-history--alarm-name my-alarm --headers This is an example output of this command. ALARM TIMESTAMP TYPE SUMMARY my-alarm 2013-05-07T18:46:16.121Z Action Published a notification to arn:aws:sns:... my-alarm 2013-05-07T18:46:16.118Z StateUpdate Alarm updated from INSUFFICIENT_DATA to OK my-alarm 2013-05-07T18:46:07.362Z ConfigurationUpdate Alarm "my-alarm" created Related topics Download • Set up the command line interface Related action • DescribeAlarmHistory Related commands • mon-describe-alarms • mon-describe-alarms-for-metric Examples API Version 2010-08-01 19 Amazon CloudWatch Command Line Reference mon-describe-alarms Description Gets information on the specified alarms. If you don't specify an alarm name, this command returns information about all of your alarms. You can retrieve alarms by using only the alarm name prefix, the alarm state, or an action prefix. Syntax mon-describe-alarms [AlarmNames [AlarmNames ...]] [--action-prefix value] [--alarm-name-prefix value] [--state-value value] [Common Options] Options Name Description AlarmNames AlarmNames The names of the alarms. You can also set this value using --alarm-name . You can specify this option multiple times. Type: Argument Valid values: An existing alarm name, otherwise no response is returned. Default: n/a, displays all alarms by default. Required: No --action-prefix VALUE Prefix of action names. Type: Argument Valid values: The prefix of an existing action name, in ARN format. Default: n/a, display the first action by default. Required: No mon-describe-alarms API Version 2010-08-01 20 Amazon CloudWatch Name Description Command Line Reference --alarm-name-prefix VALUE Prefix of alarm names. Type: Argument Valid values: The prefix of an existing alarm name. Default: n/a Required: No --state-value VALUE The state of the alarm. Type: Enumeration Valid values: OK, ALARM, or INSUFFICIENT_DATA Default: All alarm states. Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Common options API Version 2010-08-01 21 Amazon CloudWatch Name Command Line Reference Description Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. Type: String Valid values: Any string. Default: Comma (,) Common options API Version 2010-08-01 22 Amazon CloudWatch Name --headers -I, --access-key-id VALUE Command Line Reference Description If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 23 Amazon CloudWatch |
acw-cli-006 | acw-cli.pdf | 6 | delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 23 Amazon CloudWatch Name Description Command Line Reference -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None --region VALUE The region requests are directed to. You can use the environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. Common options API Version 2010-08-01 24 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false Common options API Version 2010-08-01 25 Amazon CloudWatch Name Description Command Line Reference --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Output This command returns a table that contains the following: • ALARM - Alarm name. • DESCRIPTION - The alarm description. This column appears only in the --show-long view. • STATE - The alarm state. Output API Version 2010-08-01 26 Amazon CloudWatch Command Line Reference • STATE_REASON - A human-readable reason for state. This column appears only in the --show- long view. • STATE_REASON_DATA - A machine-readable reason for state (JSON format). This column appears only in the --show-long view. • ENABLED - Enables or disables actions. This column appears only in the --show-long view. • OK_ACTIONS - The action to execute on OK status. This column appears only in the --show-long view. • ALARM_ACTIONS - The action to execute on ALARM status. • INSUFFICIENT_DATA_ACTIONS - The action to execute on INSUFFICIENT_DATA status. This column appears only in the --show-long view. • NAMESPACE - A namespace for the metric. • METRIC_NAME - The name of the metric. • DIMENSIONS - The metric dimensions. This column appears only in the --show-long view. • PERIOD - The period. • STATISTIC - The statistic (Average, Minimum, Maximum, Sum, SampleCount). • EXTENDEDSTATISTIC - The percentile statistic. • UNIT - The unit. This column appears only in the --show-long view. • EVAL_PERIODS - The number of periods to evaluate the metric. • COMPARISON - The comparison operator. • THRESHOLD - The threshold. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example describes all of your alarms whose name starts with my-alarm. mon-describe-alarms --alarm-name-prefix |
acw-cli-007 | acw-cli.pdf | 7 | The name of the metric. • DIMENSIONS - The metric dimensions. This column appears only in the --show-long view. • PERIOD - The period. • STATISTIC - The statistic (Average, Minimum, Maximum, Sum, SampleCount). • EXTENDEDSTATISTIC - The percentile statistic. • UNIT - The unit. This column appears only in the --show-long view. • EVAL_PERIODS - The number of periods to evaluate the metric. • COMPARISON - The comparison operator. • THRESHOLD - The threshold. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example describes all of your alarms whose name starts with my-alarm. mon-describe-alarms --alarm-name-prefix my-alarm --headers This is an example output of this command. Examples API Version 2010-08-01 27 Amazon CloudWatch Command Line Reference ALARM STATE ALARM_ACTIONS NAMESPACE METRIC_NAME PERIOD STATISTIC EVAL_PERIODS COMPARISON THRESHOLD my-alarm1 OK arn:aws:sns:.. AWS/EC2 CPUUtilization 60 Average 3 GreaterThanThreshold 100.0 my-alarm2 OK arn:aws:sns:.. AWS/EC2 CPUUtilization 60 Average 5 GreaterThanThreshold 80o.0 Related topics Download • Set up the command line interface Related action • DescribeAlarms Related commands • mon-describe-alarm-history • mon-describe-alarms-for-metric mon-describe-alarms-for-metric Description Gets information about the alarms associated with the specified metric. Syntax mon-describe-alarms-for-metric --metric-name value --namespace value [-- dimensions "key1=value1,key2=value2..."] [--period value] [--statistic value] [--extendedstatistic value] [--unit value] [Common Options] Related topics API Version 2010-08-01 28 Amazon CloudWatch Options Command Line Reference Name Description --dimensions - "key1=val ue1,key2=value2... The dimensions associated with the metric. You can specify dimensions two ways and the formats can be combined or used interchangeably: • One option per dimension: --dimensions "key1=val ue1" --dimensions "key2=value2" • All in one option: --dimensions "key1=value1,key2= value2" Type: Map Valid values: A string of the format name=value, where the key is the name of the dimension, and the value is the dimension's value. The dimension names, and values must be an ANSI string between 1 and 250 characters long. A maximum of 10 dimensions are allowed. Default: n/a Required: No --metric-name VALUE The name of the metric whose associated alarms you want to search for. Type: Argument Valid values: A valid metric name between 1 and 255 characters in length. Default: n/a Required: Yes Options API Version 2010-08-01 29 Amazon CloudWatch Name --namespace VALUE Command Line Reference Description The namespace of the metric associated with the alarm. For more information about namespaces, see AWS Namespaces. Type: String Valid values: A valid namespace between 1 and 250 characters in length. Default: n/a Required: Yes --period VALUE The period to filter the alarms by. Only alarms that evaluate metrics at this period will be included in the results. If this isn't specified alarms on any period will --statistic VALUE be included . Type: Argument Valid values: A number, in seconds that is a multiple of 60 seconds. Default: n/a Required: No The statistic to filter alarms by. Only alarms on the specified statistic will be included. If this parameter isn't specified, alarms on any statistic are included. Type: Enumeration Valid values: SampleCount, Average, Sum, Minimum or Maximum Default: n/a Required: No Options API Version 2010-08-01 30 Amazon CloudWatch Name Description Command Line Reference --extendedstatistic VALUE The percentile statistic to filter alarms by. Only alarms on the specified statistic are included. If this parameter isn't specified, alarms on any statistic are included. Type: String Valid values: Any percentile, with up to two decimal places (for example, p95.45). Default: n/a Required: No Options API Version 2010-08-01 31 Amazon CloudWatch Name --unit VALUE Command Line Reference Description The unit to filter the alarms by. Only alarms on the specified statistics will be included. If this isn't specified than alarms on any units will be included. If the alarm doesn't have a unit specified than the only way to search for the alarm is to omit this option. Type: Enumeration Valid values: One of the following: • Seconds • Microseconds • Milliseconds • Bytes • Kilobytes • Megabytes • Gigabytes • Terabytes • Bits • Kilobits • Megabits • Gigabits • Terabits • Percent • Count • Bytes/Second • Kilobytes/Second • Megabytes/Second • Gigabytes/Second • Terabytes/Second • Bits/Second Options API Version 2010-08-01 32 Amazon CloudWatch Name Command Line Reference Description • Kilobits/Second • Megabits/Second • Gigabits/Second • Terabits/Second • Count/Second • None Default: n/a Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can |
acw-cli-008 | acw-cli.pdf | 8 | the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Common options API Version 2010-08-01 33 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API Version 2010-08-01 34 Amazon CloudWatch Name Description Command Line Reference -I, --access-key-id VALUE The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None Common options API Version 2010-08-01 35 Amazon CloudWatch Name Description Command Line Reference --region VALUE The region requests are directed to. You can use the S, --secret-key VALUE environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. Common options API Version 2010-08-01 36 Amazon CloudWatch Name Description Command Line Reference --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 37 Amazon CloudWatch Output Command Line Reference This command returns a table that contains the following: • ALARM - Alarm name. • DESCRIPTION - The alarm description. This column appears only in the --show-long view. • STATE - The alarm state. • STATE_REASON - A human-readable reason for |
acw-cli-009 | acw-cli.pdf | 9 | variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 37 Amazon CloudWatch Output Command Line Reference This command returns a table that contains the following: • ALARM - Alarm name. • DESCRIPTION - The alarm description. This column appears only in the --show-long view. • STATE - The alarm state. • STATE_REASON - A human-readable reason for state. This column appears only in the --show- long view. • STATE_REASON_DATA - A machine-readable reason for state (JSON format). This column appears only in the --show-long view. • ENABLED - Enables or disables actions. This column appears only in the --show-long view. • OK_ACTIONS - The action to execute on OK status. This column appears only in the --show-long view. • ALARM_ACTIONS - The action to execute on ALARM status. • INSUFFICIENT_DATA_ACTIONS - The action to execute on INSUFFICIENT_DATA status. This column appears only in the --show-long view. • NAMESPACE - A namespace for the metric. • METRIC_NAME - The name of the metric. • DIMENSIONS - The metric dimensions. This column appears only in the --show-long view. • PERIOD - The period. • STATISTIC - The statistic (Average, Minimum, Maximum, Sum, SampleCount). • EXTENDEDSTATISTIC - The percentile statistic. • UNIT - The unit. This column appears only in the --show-long view. • EVAL_PERIODS - The number of periods to evaluate the metric. • COMPARISON - The comparison operator. • THRESHOLD - The threshold. The Amazon CloudWatch CLI displays errors on stderr. Output API Version 2010-08-01 38 Amazon CloudWatch Examples Example request Command Line Reference This example describes an alarm for a given metric. mon-describe-alarms-for-metric--metric-name CPUUtilization --namespace AWS/EC2 -- dimensions InstanceId=i-abcdef This is an example output of this command. ALARM STATE ALARM_ACTIONS NAMESPACE METRIC_NAME PERIOD STATISTIC EVAL_PERIODS COMPARISON THRESHOLD my-alarm1 OK arn:aws:sns:.. AWS/EC2 CPUUtilization 60 Average 3 GreaterThanThreshold 100.0 my-alarm2 OK arn:aws:sns:.. AWS/EC2 CPUUtilization 60 Average 5 GreaterThanThreshold 80.0 Related topics Download • Set up the command line interface Related action • DescribeAlarmForMetric Related commands • mon-describe-alarm-history • mon-describe-alarms mon-disable-alarm-actions Description Disables all actions for the specified alarms. Examples API Version 2010-08-01 39 Amazon CloudWatch Syntax Command Line Reference mon-disable-alarm-actions [AlarmNames [AlarmNames ...]] [Common Options] Options Name Description AlarmNames AlarmNames The names of the alarms. You can also set this value using --alarm-name . Type: Argument Valid values: A valid list of alarm names. Default: n/a Required: Yes Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. Syntax API Version 2010-08-01 40 Amazon CloudWatch Name Description Command Line Reference -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. Type: String Valid values: Any string. Default: Comma (,) Common options API Version 2010-08-01 41 Amazon CloudWatch Name --headers -I, --access-key-id VALUE Command Line Reference Description If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 42 Amazon CloudWatch Name Description Command Line Reference -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise |
acw-cli-010 | acw-cli.pdf | 10 | key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 42 Amazon CloudWatch Name Description Command Line Reference -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None --region VALUE The region requests are directed to. You can use the environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. Common options API Version 2010-08-01 43 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false Common options API Version 2010-08-01 44 Amazon CloudWatch Name Description Command Line Reference --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Output This command disables alarm actions for the specified alarms. The Amazon CloudWatch CLI displays errors on stderr. Output API Version 2010-08-01 45 Amazon CloudWatch Examples Example request This example disables all actions for an alarm called my-alarm. mon-disable-alarm-actions --alarm-name my-alarm Command Line Reference Related topics Download • Set up the command line interface Related action • DisableAlarmActions Related commands • mon-enable-alarm-actions • mon-delete-alarms mon-enable-alarm-actions Description Enables all actions for the specified alarms. Syntax mon-enable-alarm-actions [AlarmNames [AlarmNames ...]] [Common Options] Examples API Version 2010-08-01 46 Amazon CloudWatch Options Command Line Reference Name Description AlarmNames AlarmNames The names of the alarms. You can also set this value using --alarm-name . Type: Argument Valid values: A valid list of alarm names. Default: n/a Required: Yes Common options Name Description --aws-credential-file VALUE -C, --ec2-cert-file-path VALUE Options The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. API Version 2010-08-01 47 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The |
acw-cli-011 | acw-cli.pdf | 11 | your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. API Version 2010-08-01 47 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API Version 2010-08-01 48 Amazon CloudWatch Name Description Command Line Reference -I, --access-key-id VALUE The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None Common options API Version 2010-08-01 49 Amazon CloudWatch Name Description Command Line Reference --region VALUE The region requests are directed to. You can use the S, --secret-key VALUE environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. Common options API Version 2010-08-01 50 Amazon CloudWatch Name Description Command Line Reference --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 51 Command Line Reference Amazon CloudWatch Output This command enables alarm actions for the specified alarms. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example enables all actions for the alarm named my-alarm. mon-enable-alarm-actions --alarm-name my-alarm Related topics Download • Set up the command line interface Related action • EnableAlarmActions Related commands • mon-disable-alarm-actions • mon-delete-alarms mon-get-stats Description Gets time-series data for the specified statistics. Output API Version 2010-08-01 52 Amazon CloudWatch Note Command Line Reference When you create a new metric using the mon-put-data command, it can take up to two minutes before you can retrieve statistics on the new metric using the mon-get-stats command. However, it can take up to fifteen minutes before the |
acw-cli-012 | acw-cli.pdf | 12 | displays errors on stderr. Examples Example request This example enables all actions for the alarm named my-alarm. mon-enable-alarm-actions --alarm-name my-alarm Related topics Download • Set up the command line interface Related action • EnableAlarmActions Related commands • mon-disable-alarm-actions • mon-delete-alarms mon-get-stats Description Gets time-series data for the specified statistics. Output API Version 2010-08-01 52 Amazon CloudWatch Note Command Line Reference When you create a new metric using the mon-put-data command, it can take up to two minutes before you can retrieve statistics on the new metric using the mon-get-stats command. However, it can take up to fifteen minutes before the new metric appears in the list of metrics retrieved using the mon-list-metrics command. Syntax mon-get-stats MetricName --namespace value --statistics value[,value...] [--dimensions "key1=value1,key2=value2..." ] [--end-time value] [--period value] [--start-time value] [--unit value] [Common Options] Options Name MetricName Description The name of the metric. You can also set this value using --metric-name . Type: Argument Valid values: Any valid metric name between 1 and 255 characters. Default: n/a Required: Yes --dimensions "key1=val ue1,key2=value2..." The dimensions of the metric. You can specify dimensions two ways and the formats can be combined or used interchangeably: • One option per dimension: --dimensions "key1=val ue1" --dimensions "key2=value2" • All in one option: --dimensions "key1=value1,key2= value2" Syntax API Version 2010-08-01 53 Amazon CloudWatch Name Description Type: Map Command Line Reference --end-time VALUE Valid values: A string of the format name=value, where the key is the name of the dimension, and the value is the dimension's value. The dimension names, and values must be an ANSI string between 1 and 250 characters long. A maximum of 10 dimensions are allowed. Default: n/a Required: No The latest allowed timestamp for returned data points. The ending time is exclusive. Timestamps are specified using ISO8601 combined format. For example the date and time July 30th, 2013 at 12:30:00 PST would be represented as 2013-07-30T12:30:00-07:00, or in UTC: 2013-07-30T19:30:00Z. The highest resolution that can be returned by CloudWatch is 1 minute, as such all timestamps are rounded down to the nearest minute. Type: Argument Valid values: A valid timestamp represented in ISO8601 format with time zone offset, or UTC indicator. Default: The current date/time. Required: No Options API Version 2010-08-01 54 Amazon CloudWatch Name Description Command Line Reference -n, --namespace VALUE The namespace of the metric. For more information about namespaces, see AWS Namespaces. Type: String Valid values: A valid namespace between 1 and 250 characters in length. Default: n/a Required: Yes --period VALUE The granularity, in seconds, to retrieve statistics for. The period must be at least 60 seconds and must be a multiple of 60. Type: Argument Valid values: A number, in seconds that is a multiple of 60 seconds. Default: 60 seconds. Required: No -s, --statistics VALUE1,VA The statistics to be returned for the specified metric. LUE2,VALUE3... Type: Enumeration Valid values: Average, Sum, Maximum, or Minimum Default: n/a Required: Yes Options API Version 2010-08-01 55 Amazon CloudWatch Name --start-time VALUE Command Line Reference Description The first allowed timestamp for returned data points. The starting time is inclusive. Timestamps are specified using ISO8601 combined format. For example the date and time July 30th, 2013 at 12:30:00 PST would be represented as 2013-07-30T12:30:00-07:00, or in UTC: 2013-07-30T19:30:00Z. The highest resolution that can be returned by CloudWatch is 1 minute, as such all timestamps are rounded down to the nearest minute. Type: Argument Valid values: A valid timestamp represented in ISO8601 format with time zone offset, or UTC indicator. Default: One hour before the current time. Required: No Options API Version 2010-08-01 56 Amazon CloudWatch Name --unit VALUE Command Line Reference Description The unit to retrieve the metrics for. Metrics may be reported in multiple units, this retrieve a specific unit for a given metric. Not requesting a unit will result in all units being returned. If the metric is only ever reported with one unit this will have no effect. Type: Enumeration Valid values: One of the following: • Seconds • Microseconds • Milliseconds • Bytes • Kilobytes • Megabytes • Gigabytes • Terabytes • Bits • Kilobits • Megabits • Gigabits • Terabits • Percent • Count • Bytes/Second • Kilobytes/Second • Megabytes/Second • Gigabytes/Second • Terabytes/Second • Bits/Second Options API Version 2010-08-01 57 Amazon CloudWatch Name Command Line Reference Description • Kilobits/Second • Megabits/Second • Gigabits/Second • Terabits/Second • Count/Second • None Default: n/a Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to |
acw-cli-013 | acw-cli.pdf | 13 | API Version 2010-08-01 57 Amazon CloudWatch Name Command Line Reference Description • Kilobits/Second • Megabits/Second • Gigabits/Second • Terabits/Second • Count/Second • None Default: n/a Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Common options API Version 2010-08-01 58 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API Version 2010-08-01 59 Amazon CloudWatch Name Description Command Line Reference -I, --access-key-id VALUE The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None Common options API Version 2010-08-01 60 Amazon CloudWatch Name Description Command Line Reference --region VALUE The region requests are directed to. You can use the S, --secret-key VALUE environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. Common options API Version 2010-08-01 61 Amazon CloudWatch Name Description Command Line Reference --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 62 Command Line Reference Amazon CloudWatch Output This command returns a table |
acw-cli-014 | acw-cli.pdf | 14 | exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 62 Command Line Reference Amazon CloudWatch Output This command returns a table that contains the following: • Time - The time the metrics were taken. • SampleCount - No description available for this column. • Average - The average value. • Sum - The sum of values. • Minimum - The minimum observed value. • Maximum - The maximum observed value. • Unit - The unit of the metric. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example returns the average, minimum, and maximum CPU utilization for EC2 instance i- c07704a9, at 1 hour resolution. mon-get-stats CPUUtilization --start-time 2013-02-14T23:00:00.000Z --end-time 2013-03-14T23:00:00.000Z --period 3600 --statistics "Average,Minimum,Maximum" -- namespace "AWS/EC2" --dimensions "InstanceId=i-c07704a9" This is an example of an output of the Samples and Average metrics at one minute resolution. Time Samples Average Unit 2013-05-19 00:03:00 2.0 0.19 Percent 2013-05-19 00:04:00 2.0 0 Percent 2013-05-19 00:05:00 2.0 0 Percent 2013-05-19 00:06:00 2.0 0 Percent 2013-05-19 00:07:00 2.0 0 Percent 2013-05-19 00:08:00 2.0 0 Percent 2013-05-19 00:09:00 2.0 0 Percent 2013-05-19 00:10:00 2.0 0 Percent 2013-05-19 00:11:00 2.0 0 Percent Output API Version 2010-08-01 63 Amazon CloudWatch Command Line Reference 2013-05-19 00:12:00 2.0 0.195 Percent 2013-05-19 00:13:00 2.0 0.215 Percent ... Example request This example returns CPU utilization across your EC2 fleet. mon-get-stats CPUUtilization --start-time 2013-02-14T23:00:00.000Z --end-time 2013-03-14T23:00:00.000Z --period 3600 --statistics "Average,Minimum,Maximum" -- namespace "AWS/EC2" Example request This example returns the average, minimum, and maximum request count made to the test stack of MyService for a particular user, at 1 hour resolution. mon-get-stats RequestCount --start-time 2013-11-24T23:00:00.000Z --end-time 2013-11-25T23:00:00.000Z --period 3600 --statistics "Average,Minimum,Maximum" -- namespace "MyService" --dimensions "User=SomeUser,Stack=Test" Example request This example shows RequestCount statistics across all of "MyService". mon-get-stats RequestCount --start-time 2013-11-24T23:00:00.000Z --end-time 2013-11-25T23:00:00.000Z --period 3600 --statistics "Average,Minimum,Maximum,SampleCount" --namespace "MyService" Related topics Download • Set up the command line interface Related action • GetMetricStatistics Related topics API Version 2010-08-01 64 Command Line Reference Amazon CloudWatch Related commands • mon-list-metrics • mon-describe-alarms mon-list-metrics Description Lists the names, namespaces, and dimensions of the metrics associated with your AWS account. You can filter metrics using any combination of metric name, namespace, or dimensions. If you do not specify a filter, all possible matches for the attribute are returned. Note The mon-list-metrics command can take up to fifteen minutes to report new metric names, namespaces, and dimensions added by calls to mon-put-data. The data points put by mon-put-data, or other methods will be available by mon-get-statistics in less than five minutes. Syntax mon-list-metrics [--dimensions "key1=value1,key2=value2..."] [--metric-name value] [--namespace value] [Common Options] Options Name Description -d, --dimensions "key1=val ue1,key2=value2..." The dimensions of the metric to retrieve. You can specify dimensions two ways and the formats can be combined or used interchangeably: • One option per dimension: --dimensions "key1=val ue1" --dimensions "key2=value2" mon-list-metrics API Version 2010-08-01 65 Amazon CloudWatch Name -m, --metric-name VALUE Command Line Reference Description • All in one option: --dimensions "key1=value1,key2= value2" If no dimensions are specified, no filtering of dimensions will be done. Any other requested filters will still be applied. To be included in the result a metric must contain all specified dimensions, although the metric may contain additional dimensions beyond the requested metrics. Type: Map Valid values: A string of the format name=value, where the key is the name of the dimension, and the value is the dimension's value. The dimension names, and values must be an ANSI string between 1 and 250 characters long. A maximum of 10 dimensions are allowed. Default: n/a Required: No The name of the metric. To be included in the results, the metric name must match the requested metric name exactly. If no metric name is specified no filtering is done. Any other requested filters are applied. Type: Simple Valid values: Any valid metric name between 1 and 250 characters in length. Default: n/a Required: No Options API Version 2010-08-01 66 Amazon CloudWatch Name Description Command Line Reference -n, --namespace VALUE The namespace to use to filter metrics. For more information about namespaces, see AWS Namespaces. Type: String Valid values: A valid namespace between 1 and 250 characters in length. Default: n/a Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the |
acw-cli-015 | acw-cli.pdf | 15 | applied. Type: Simple Valid values: Any valid metric name between 1 and 250 characters in length. Default: n/a Required: No Options API Version 2010-08-01 66 Amazon CloudWatch Name Description Command Line Reference -n, --namespace VALUE The namespace to use to filter metrics. For more information about namespaces, see AWS Namespaces. Type: String Valid values: A valid namespace between 1 and 250 characters in length. Default: n/a Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Common options API Version 2010-08-01 67 Amazon CloudWatch Name Command Line Reference Description Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API Version 2010-08-01 68 Amazon CloudWatch Name Description Command Line Reference -I, --access-key-id VALUE The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None Common options API Version 2010-08-01 69 Amazon CloudWatch Name Description Command Line Reference --region VALUE The region requests are directed to. You can use the S, --secret-key VALUE environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. Common options API Version 2010-08-01 70 Amazon CloudWatch Name Description Command Line Reference --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for |
acw-cli-016 | acw-cli.pdf | 16 | shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 71 Amazon CloudWatch Output Command Line Reference This command returns a table that contains the following: • Metric Name - The name of the metric attached to this metric. • Namespace - The namespace associated with this metric. • Dimensions - The dimension names and values associated with this metric. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example returns a list of all your metrics. mon-list-metrics This is an example of an output of a call to 'mon-list-metrics'. Metric Name Namespace Dimensions CPUUtilization AWS/EC2 {InstanceId=i-e7e48a8e} CPUUtilization AWS/EC2 {InstanceId=i-231d744a} CPUUtilization AWS/EC2 {InstanceId=i-22016e4b} CPUUtilization AWS/EC2 {InstanceId=i-b0345cd9} CPUUtilization AWS/EC2 {InstanceId=i-539dff3a} CPUUtilization AWS/EC2 {InstanceId=i-af3544c6} CPUUtilization AWS/EC2 {InstanceId=i-d4f29ebd} CPUUtilization AWS/EC2 {ImageId=ami-de4daab7} ... Example request This example lists your metrics with the specified name. mon-list-metrics --metric-name RequestCount Example request This example lists your metrics that belong to the specified namespace. Output API Version 2010-08-01 72 Amazon CloudWatch Command Line Reference mon-list-metrics --namespace MyService Example request This example lists your metrics with the specified dimension names and values. mon-list-metrics --dimensions "User=SomeUser,Stack=Test" Related topics Download • Set up the command line interface Related action • ListMetrics Related command • mon-describe-alarms mon-put-data Description Adds metric data points to the specified metric. This call will put time-series data, for either the raw value or valid statistic values of a given metric name. It supports the input of a single data point at a time. Note When you create a new metric using the mon-put-data command, it can take up to two minutes before you can retrieve statistics on the new metric using the mon-get-stats command. However, it can take up to fifteen minutes before the new metric appears in the list of metrics retrieved using the mon-list-metrics command. Related topics API Version 2010-08-01 73 Amazon CloudWatch Syntax Command Line Reference mon-put-data --metric-name value[--namespace value [-- dimensions "key1=value1,key2=value2..."] [--statisticValues "key1=value1,key2=value2..."] [--timestamp value] [--unit value] [--value value] [Common Options] Options Name Description -d, --dimensions "key1=value1,key2= value2..." The dimensions that uniquely identify the metric data. You can specify dimensions two ways and the formats can be combined or used interchangeably: • One option per dimension: --dimensions "key1=val ue1" --dimensions "key2=value2" • All in one option: --dimensions "key1=value1,key2= value2" Type: Map Valid values: A string of the format name=value, where the key is the name of the dimension, and the value is the dimension's value. The dimension names, and values must be an ANSI string between 1 and 250 characters long. A maximum of 10 dimensions are allowed. Default: n/a Required: No -m, --metric-name VALUE1,VA The name of the metric. LUE2,VALUE3... Type: String Valid values: Any valid metric name between 1 and 250 characters. Syntax API Version 2010-08-01 74 Amazon CloudWatch Name Description Default: n/a Required: Yes Command Line Reference n, --namespace VALUE The namespace of the metric. For more information about namespaces, see AWS Namespaces. Type: String Valid values: An ANSI string between 1 and 250 characters in length. Default: n/a Required: Yes -s, --statistic Values The statistics to store for the specified timestamp and "key1=value1,key2= value2..." metric. This option is exclusive with --value. At least one of --statisticValue or --value must be specified. Type: Map Valid values: A string containing all double values for all statistic names: SampleCount, Sum, Maximum, and Minimum. All these values must be a value between 1E-130 and 1E130. Default: n/a Required: Yes Options API Version 2010-08-01 75 Amazon CloudWatch Name -t, --timestamp VALUE Command Line Reference Description The timestamp of the data point or observation for the metric to record. Timestamps are specified using ISO8601 combined format. For example the date and time July 30th, 2013 at 12:30:00 PST would be represented as 2013-07-30T12:30:00-07:00, or in UTC: 2013-07-30T19:30:00Z. Type: Simple Valid values: A valid timestamp represented in ISO8601 format with time zone offset, or UTC indicator. Default: The current UTC time. Required: No Options API Version 2010-08-01 76 Amazon CloudWatch Name Description Command Line Reference -u, --unit VALUE The unit for the metric. Type: Enumeration Valid values: One of the following: • Seconds • Microseconds • Milliseconds • Bytes • Kilobytes • Megabytes |
acw-cli-017 | acw-cli.pdf | 17 | or observation for the metric to record. Timestamps are specified using ISO8601 combined format. For example the date and time July 30th, 2013 at 12:30:00 PST would be represented as 2013-07-30T12:30:00-07:00, or in UTC: 2013-07-30T19:30:00Z. Type: Simple Valid values: A valid timestamp represented in ISO8601 format with time zone offset, or UTC indicator. Default: The current UTC time. Required: No Options API Version 2010-08-01 76 Amazon CloudWatch Name Description Command Line Reference -u, --unit VALUE The unit for the metric. Type: Enumeration Valid values: One of the following: • Seconds • Microseconds • Milliseconds • Bytes • Kilobytes • Megabytes • Gigabytes • Terabytes • Bits • Kilobits • Megabits • Gigabits • Terabits • Percent • Count • Bytes/Second • Kilobytes/Second • Megabytes/Second • Gigabytes/Second • Terabytes/Second • Bits/Second • Kilobits/Second • Megabits/Second • Gigabits/Second • Terabits/Second Options API Version 2010-08-01 77 Amazon CloudWatch Name -v, --value VALUE Command Line Reference Description • Count/Second • None Default: n/a Required: No A single value to be recorded. The value is translate d to a statistic set of the form: SampleCount=1, Sum=VALUE, Minimum=VALUE, Maximum=VALUE. This option is exclusive of --statisticValues . Type: Simple Valid values: All values must be a number between 1E-130 and 1E130. Default: n/a Required: Yes Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Common options API Version 2010-08-01 78 Amazon CloudWatch Name Command Line Reference Description Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. Type: String Valid values: Any string. Default: Comma (,) Common options API Version 2010-08-01 79 Amazon CloudWatch Name --headers -I, --access-key-id VALUE Command Line Reference Description If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 80 Amazon CloudWatch Name Description Command Line Reference -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None --region VALUE The region requests are directed to. You can use the environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. Common options API Version 2010-08-01 81 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request |
acw-cli-018 | acw-cli.pdf | 18 | us-east-1, unless the EC2_REGION environment variable is set. Common options API Version 2010-08-01 81 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false Common options API Version 2010-08-01 82 Amazon CloudWatch Name Description Command Line Reference --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Output This command adds metric data points to a metric. The Amazon CloudWatch CLI displays errors on stderr. Output API Version 2010-08-01 83 Amazon CloudWatch Examples Example request Command Line Reference This example puts statistic data for RequestCount in the MyService namespace. The metric contains no dimensions and so represents the overall RequestCount across the entire service. The measurement is a pre-aggregated statisticValue representing five earlier measurements whose maximum was 70, whose minimum was 30, and whose sum was 250. mon-put-data --metric-name RequestCount --namespace "MyService" --timestamp 2013-11-25T00:00:00.000Z --statisticValues "Sum=250,Minimum=30,Maximum=70,SampleCount=5" Example request This example puts user-specific RequestCount test data in the MyService namespace. The user and stack name are stored as dimensions in order to distinguish this metric from the service-wide metric in the example above. mon-put-data --metric-name RequestCount --namespace "MyService" --dimensions "User=SomeUser,Stack=Test" --timestamp 2013-11-25T00:00:00.000Z --value 50 Related topics Download • Set up the command line interface Related action • PutMetricData Related command • mon-put-metric-alarm Examples API Version 2010-08-01 84 Amazon CloudWatch Command Line Reference mon-put-metric-alarm Description Creates or updates an alarm and associates it with the specified CloudWatch metric. You can also use this command to associate one or more Amazon Simple Notification Service (Amazon SNS) resources with an alarm. When this operation creates an alarm, the alarm state is immediately set to INSUFFICIENT_DATA. The alarm is evaluated and its StateValue is set appropriately. Any actions associated with the StateValue is then executed. Note When updating an existing alarm, StateValue is left unchanged. Syntax mon-put-metric-alarm AlarmName --comparison-operator value --evaluation- periods value --metric-name value --namespace value --period value [-- statistic value] [--extendedstatistic value] --threshold value [-- actions-enabled value] [--alarm-actions value[,value...] ] [--alarm- description value] [--dimensions "key1=value1,key2=value2..."] [--ok- actions value[,value...] ] [--unit value] [--insufficient-data-actions value[,value...]] [Common Options] Options Name AlarmName Description The name of the alarm to update or create. The name must be unique within your AWS account. You can also set this value using --alarm-name . Type: Argument Valid values: A UTF-8 string. mon-put-metric-alarm API Version 2010-08-01 85 Amazon CloudWatch Name Description Default: n/a Required: Yes Command Line Reference --actions-enabled VALUE Indicates whether actions should be executed when the alarm changes state. Type: Boolean Valid values: True or False Default: True Required: No Options API Version 2010-08-01 86 Amazon CloudWatch Name Description Command Line Reference --alarm-actions VALUE1,VA LUE2,VALUE3... The actions (up to five) to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). Using alarm actions, you can publish to an Amazon SNS topic, activate an Amazon EC2 Auto Scaling policy, or stop, terminate, or recover an Amazon EC2 instance. Note If you are using an AWS Identity and Access Management (IAM) account to create or modify an alarm, you must have the following Amazon EC2 permissions: • ec2:DescribeInstanceStatus and ec2:DescribeInstances on Amazon EC2 instance status metrics. for all alarms • ec2:StopInstances for alarms with stop actions. • ec2:TerminateInstances for alarms with terminate actions. • ec2:DescribeInstanceRecover yAttribute , and ec2:Recov erInstances actions. for alarms with recover If you have read/write permissions for Amazon CloudWatch but not for Amazon EC2, you can still create an alarm but the stop or |
acw-cli-019 | acw-cli.pdf | 19 | Scaling policy, or stop, terminate, or recover an Amazon EC2 instance. Note If you are using an AWS Identity and Access Management (IAM) account to create or modify an alarm, you must have the following Amazon EC2 permissions: • ec2:DescribeInstanceStatus and ec2:DescribeInstances on Amazon EC2 instance status metrics. for all alarms • ec2:StopInstances for alarms with stop actions. • ec2:TerminateInstances for alarms with terminate actions. • ec2:DescribeInstanceRecover yAttribute , and ec2:Recov erInstances actions. for alarms with recover If you have read/write permissions for Amazon CloudWatch but not for Amazon EC2, you can still create an alarm but the stop or terminate actions won’t be performed on the Amazon EC2 instance. However, if you are later granted permission to use the associated Amazon EC2 APIs, the alarm actions you created earlier will Options API Version 2010-08-01 87 Amazon CloudWatch Name Description Command Line Reference be performed. For more information about IAM permissions, see Permissions and Policies in IAM User Guide. If you are using an IAM role (for example, an Amazon EC2 instance profile), you cannot stop or terminate the instance using alarm actions. However, you can still see the alarm state and perform any other actions such as Amazon SNS notifications or Amazon EC2 Auto Scaling policies. If you are using temporary security credentials granted using the AWS Security Token Service (AWS STS), you cannot stop or terminate an Amazon EC2 instance using alarm actions. Type: String Valid values: An ARN for an Amazon SNS topic, an Auto Scaling policy, or an ARN to stop, terminate, or recover an Amazon EC2 instance. Default: n/a Required: No --alarm-description VALUE The description of the alarm. Type: String Valid values: Any Unicode string between 1 and 255 characters in length. Default: n/a Required: No Options API Version 2010-08-01 88 Amazon CloudWatch Name Description Command Line Reference --comparison-operator VALUE The comparison operator used to compare a data point to the threshold. --dimensions "key1=val ue1,key2=value2..." Type: Enumeration Valid values: one of GreaterThanOrEqualToThresho ld, GreaterThanThreshold, LessThanThreshold, or LessThanOrEqualToThreshold Default: n/a Required: Yes The dimensions of the metric to create that you want to create an alarm for. You can specify dimensions two ways and the formats can be combined or used interchangeably: • One option per dimension: --dimensions "key1=val ue1" --dimensions "key2=value2" • All in one option: --dimensions "key1=value1,key2= value2" Type: Map Valid values: A string of the format name=value, where the key is the name of the dimension, and the value is the dimension's value. The dimension names, and values must be an ANSI string between 1 and 250 characters long. A maximum of 10 dimensions are allowed. Default: n/a Required: No Options API Version 2010-08-01 89 Amazon CloudWatch Name Description Command Line Reference --evaluation-periods VALUE The number of consecutive periods for which the value of the metric is compared to the threshold to determine alarm status. Type: Integer Valid values: A number greater than zero. Default: n/a Required: Yes --metric-name VALUE The name of the metric on which to alarm. Type: Argument Valid values: An ANSI string between 1 and 250 characters in length. Default: n/a Required: Yes --namespace VALUE The namespace of the metric on which to alarm. For more information about namespaces, see AWS Namespaces. Type: String Valid values: An ANSI string between 1 and 250 characters in length. Default: n/a Required: Yes Options API Version 2010-08-01 90 Amazon CloudWatch Name Description Command Line Reference --ok-actions VALUE1,VA LUE2,VALUE3... The actions (up to five) to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: String Valid values: A valid ARN identifier. Default: n/a Required: No --period VALUE The period of metric on which to alarm (in seconds). Type: Argument Valid values: A number, in seconds that is a multiple of 60 seconds. Default: n/a Required: Yes --statistic VALUE The statistic of the metric on which to alarm. Type: Enumeration Valid values: SampleCount, Average, Sum, Minimum, or Maximum Default: n/a Required: You must specify --statistic or --extende dstatistic. Options API Version 2010-08-01 91 Amazon CloudWatch Name Description Command Line Reference --extendedstatistic VALUE The percentile statistic of the metric on which to alarm. Type: String Valid values: Any percentile, with up to two decimal places (for example, p95.45). Default: n/a Required: You must specify --statistic or --extende dstatistic. --threshold VALUE The threshold that data points are compared with to determine the alarm state. Type: Double Valid values: A double value. All values must be a number between 1E-130 and 1E130. Default: n/a Required: Yes Options API Version 2010-08-01 92 Amazon CloudWatch Name Description Command Line Reference --unit VALUE The unit of the metric on which to alarm. Type: Enumeration Valid values: One of the following: • Seconds • Microseconds • Milliseconds • Bytes • Kilobytes • Megabytes • Gigabytes • |
acw-cli-020 | acw-cli.pdf | 20 | up to two decimal places (for example, p95.45). Default: n/a Required: You must specify --statistic or --extende dstatistic. --threshold VALUE The threshold that data points are compared with to determine the alarm state. Type: Double Valid values: A double value. All values must be a number between 1E-130 and 1E130. Default: n/a Required: Yes Options API Version 2010-08-01 92 Amazon CloudWatch Name Description Command Line Reference --unit VALUE The unit of the metric on which to alarm. Type: Enumeration Valid values: One of the following: • Seconds • Microseconds • Milliseconds • Bytes • Kilobytes • Megabytes • Gigabytes • Terabytes • Bits • Kilobits • Megabits • Gigabits • Terabits • Percent • Count • Bytes/Second • Kilobytes/Second • Megabytes/Second • Gigabytes/Second • Terabytes/Second • Bits/Second • Kilobits/Second • Megabits/Second • Gigabits/Second • Terabits/Second Options API Version 2010-08-01 93 Amazon CloudWatch Name Command Line Reference Description • Count/Second • None Default: n/a Required: No --insufficient-data-actions VALUE1,VALUE2,VALUE3... The actions (up to five) to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). Type: String Valid values: A valid ARN identifier. Default: n/a Required: No Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Common options API Version 2010-08-01 94 Amazon CloudWatch Name Command Line Reference Description Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Type: String Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. Type: String Valid values: Any string. Default: Comma (,) Common options API Version 2010-08-01 95 Amazon CloudWatch Name --headers -I, --access-key-id VALUE Command Line Reference Description If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None Common options API Version 2010-08-01 96 Amazon CloudWatch Name Description Command Line Reference -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None --region VALUE The region requests are directed to. You can use the environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. Common options API Version 2010-08-01 97 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request Displays the URL the CLI uses to call AWS. Type: |
acw-cli-021 | acw-cli.pdf | 21 | API Version 2010-08-01 97 Amazon CloudWatch Name S, --secret-key VALUE Command Line Reference Description The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false Common options API Version 2010-08-01 98 Amazon CloudWatch Name Description Command Line Reference --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Output This command creates or updates an alarm associated with the specified metric. The Amazon CloudWatch CLI displays errors on stderr. Output API Version 2010-08-01 99 Amazon CloudWatch Examples Example request Command Line Reference This example creates an alarm that publishes a message to a topic when CPU utilization of an EC2 instances exceeds 90 percent for three consecutive one minute periods. mon-put-metric-alarm --alarm-name my-alarm --alarm-description "some desc" \ --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 60 -- threshold 90 \ --comparison-operator GreaterThanThreshold --dimensions InstanceId=i-abcdef -- evaluation-periods 3 \ --unit Percent --alarm-actions arn:aws:sns:us-east-1:1234567890:my-topic Related topics Download • Set up the command line interface Related action • PutMetricAlarm Related command • mon-put-data mon-set-alarm-state Description Temporarily changes the alarm state of the specified alarm. On the next period, the alarm is set to its true state. Examples API Version 2010-08-01 100 Amazon CloudWatch Syntax Command Line Reference mon-set-alarm-state AlarmName --state-reason value --state-value value [-- state-reason-data value] [Common Options] Options Name AlarmName Description The name of the alarm. You can also set this value using --alarm-name . Type: Argument Valid values: A UTF-8 string. Default: n/a Required: Yes --state-reason VALUE The reason why this alarm was set to this state (human readable). Type: String Valid values: A UTF-8 string between 1 and 1023 characters. Default: n/a Required: Yes --state-reason-data VALUE The reason why this alarm was set to this state. This data is intended to be machine-readable JSON. Type: String Valid values: A valid machine-readable JSON string between 1 and 4000 characters. Default: n/a Syntax API Version 2010-08-01 101 Amazon CloudWatch Name Description Required: No Command Line Reference --state-value VALUE The state the alarm should be set to. Type: Enumeration Valid values: ALARM, OK or INSUFFICIENT_DATA Default: n/a Required: Yes Common options Name Description --aws-credential-file VALUE The location of the file with your AWS credentia ls. You can set this value using the environment variable AWS_CREDENTIAL_FILE environment variable or you provide the path to the . If you define the credential file, the file must exist or the request fails. All CloudWatch requests must be signed using your access key ID and secret access key. Type: String Valid values: A valid path to a file containing your access key ID and secret access key. Default: Uses the environment variable AWS_CREDE NTIAL_FILE , if set. -C, --ec2-cert-file-path VALUE The location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value. Type: String Common options API Version 2010-08-01 102 Amazon CloudWatch Name Command Line Reference Description Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API |
acw-cli-022 | acw-cli.pdf | 22 | EC2 or AWS Identity and Access Management. Default: Uses the environment variable EC2_CERT, if set. --connection-timeout VALUE The connection timeout value, in seconds. Type: Integer Valid values: Any positive number. Default: 30 --delimiter VALUE The delimiter to use when displaying delimited (long) results. --headers Type: String Valid values: Any string. Default: Comma (,) If you are displaying tabular or delimited results, include the column headers. If you are showing XML results, return the HTTP headers from the service request, if applicable. Type: Flag Valid values: When present, shows headers. Default: The --headers option is off by default. Common options API Version 2010-08-01 103 Amazon CloudWatch Name Description Command Line Reference -I, --access-key-id VALUE The access key ID that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: A valid access key ID. Default: None -K, --ec2-private-key-file- path VALUE The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjuncti on with EC2_CERT, otherwise the value is ignored. The value of the environment variable EC2_PRIVA TE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environme nt variable AWS_CREDENTIAL_FILE is set, or -- aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request is rejected. Type: String Valid values: The path to a valid ASN.1 private key. Default: None Common options API Version 2010-08-01 104 Amazon CloudWatch Name Description Command Line Reference --region VALUE The region requests are directed to. You can use the S, --secret-key VALUE environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region. Type: String Valid values: Any AWS region, for example, us-east-1. Default: us-east-1, unless the EC2_REGION environment variable is set. The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with -- access-key-id , otherwise this option is ignored. Type: String Valid values: Your access key ID. Default: None --show-empty-fields Shows empty fields using (nil) as a placeholder to indicate that this data was not requested. Type: Flag Valid values: None Default: Empty fields are not shown by default. Common options API Version 2010-08-01 105 Amazon CloudWatch Name Description Command Line Reference --show-request Displays the URL the CLI uses to call AWS. Type: Flag Valid values: None Default: false --show-table, --show-long, Specifies how the results are displayed: in a table, --show-xml, --quiet delimited (long), XML, or no output (quiet). The -- show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; -- show-xml is the raw return from the service; and -- quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table , --show-long , --show-xml , and --quiet. Type: Flag Valid values: None Default: --show-table -U, --url VALUE The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUD WATCH_URL . This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call. Type: String Valid values: A valid HTTP or HTTPS URL. Default: Uses the value specified in AWS_CLOUD WATCH_URL , if set. Common options API Version 2010-08-01 106 Amazon CloudWatch Output Command Line Reference This command temporarily changes an alarm's state and displays OK-Set alarm state value when the request is successful. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example sets the state of the alarm named my-alarm to OK. mon-set-alarm-state --alarm-name my-alarm --state OK Related topics Download • Set up the command line interface Related action • SetAlarmState Related command • mon-describe-alarms mon-version Description Prints the version number of the CLI and API for CloudWatch. Syntax mon-version Output API Version 2010-08-01 107 Amazon CloudWatch Output Command Line Reference This command displays the version of the CloudWatch CLI and API. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example shows the CLI and API version. mon-version The following is example output. Amazon CloudWatch CLI version 1.0.12.1 (API 2010-08-01) Related topics Download • Set up the command line interface Related Command (see --extendedstatistic parameter) • mon-cmd Output API Version 2010-08-01 108 Amazon CloudWatch Command Line Reference Document history The following table describes the important changes to the Amazon CloudWatch CLI Reference. This documentation is |
acw-cli-023 | acw-cli.pdf | 23 | mon-version Output API Version 2010-08-01 107 Amazon CloudWatch Output Command Line Reference This command displays the version of the CloudWatch CLI and API. The Amazon CloudWatch CLI displays errors on stderr. Examples Example request This example shows the CLI and API version. mon-version The following is example output. Amazon CloudWatch CLI version 1.0.12.1 (API 2010-08-01) Related topics Download • Set up the command line interface Related Command (see --extendedstatistic parameter) • mon-cmd Output API Version 2010-08-01 108 Amazon CloudWatch Command Line Reference Document history The following table describes the important changes to the Amazon CloudWatch CLI Reference. This documentation is associated with the 2010-08-01 release of CloudWatch. This guide was last Release date 28 February 2014 updated on 7 November 2017. Change Description Moved the Amazon Moved the Amazon CloudWatch CLI content from the Amazon CloudWatch User Guide to CloudWatch CLI this new guide. Updated the examples in the content from Amazon CloudSearch Developer Guide to use the Amazon CloudWatch the AWS CLI, which is a cross-service CLI with a simplified installation, unified configuration, and User Guide to consistent command line syntax. The AWS CLI is this new guide supported on Linux/Unix, Windows, and Mac. The CLI examples in this guide have been updated to use the new AWS CLI. For information about how to install and configure the new AWS CLI, see Getting Set Up with the AWS Command Line Interface in the AWS Command Line Interface User Guide. The CloudWatc h CLI is being As of November 7, 2017, we are no longer supporting the CloudWatch command line 7 November 2017 retired. interface with new functionality. It is not available for download. API Version 2010-08-01 109 |
acw-ug-001 | acw-ug.pdf | 1 | User Guide Amazon CloudWatch Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon CloudWatch User Guide Amazon CloudWatch: User Guide Copyright © 2025 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon CloudWatch Table of Contents User Guide What is Amazon CloudWatch? ........................................................................................................ 1 Operational visibility with metrics, alarms, and dashboards ............................................................... 1 Application performance monitoring (APM) ........................................................................................... 2 Infrastructure monitoring ........................................................................................................................... 2 Collect, store, and query logs .................................................................................................................... 2 Use the CloudWatch agent to gather metrics, logs, and traces from Amazon EC2 fleets .............. 3 Cross-account monitoring ........................................................................................................................... 3 Solutions catalog .......................................................................................................................................... 3 CloudWatch network monitoring .............................................................................................................. 3 Billing and costs ........................................................................................................................................... 4 Resources ........................................................................................................................................................ 4 Getting set up .................................................................................................................................. 6 Sign up for an AWS account ...................................................................................................................... 6 Create a user with administrative access ................................................................................................ 6 Sign in to the Amazon CloudWatch console .......................................................................................... 8 Set up the AWS CLI ..................................................................................................................................... 8 Analyzing, optimizing, and reducing CloudWatch costs ............................................................... 9 Analyze CloudWatch cost and usage data with Cost Explorer ............................................................ 9 To visualize and analyze CloudWatch cost and usage data ........................................................... 9 Analyze CloudWatch cost and usage data with AWS Cost and Usage Reports and Athena ........ 14 To analyze cost and usage data with AWS Cost and Usage Reports and Athena ..................... 15 Optimizing and reducing costs of CloudWatch metrics ..................................................................... 18 Custom metrics ..................................................................................................................................... 18 Detailed monitoring ............................................................................................................................. 19 Embedded metrics ................................................................................................................................ 21 API requests ........................................................................................................................................... 22 CloudWatch metric streams ................................................................................................................ 25 Optimizing and reducing costs of CloudWatch alarms ...................................................................... 26 Metric alarms ......................................................................................................................................... 26 Metrics Insights query alarms ............................................................................................................ 27 Composite alarms ................................................................................................................................. 27 Optimizing and reducing costs of CloudWatch Container Insights .................................................. 29 Optimizing and reducing costs of CloudWatch Logs .......................................................................... 30 Dashboards ..................................................................................................................................... 36 iii Amazon CloudWatch User Guide Getting started with automatic dashboards ........................................................................................ 38 Viewing the cross-service dashboard ............................................................................................... 39 Removing a service from appearing in the cross-service dashboard ......................................... 41 Viewing a dashboard for a single service ........................................................................................ 41 Viewing a dashboard for a resource group ..................................................................................... 43 Creating a customized dashboard .......................................................................................................... 44 Creating a cross-account cross-Region dashboard with the console ............................................... 45 Create a cross-account cross-Region dashboard programmatically ................................................ 46 Creating a graph with metrics from different accounts and Regions .............................................. 49 Adding an alarm from a different account to a cross-account dashboard ..................................... 50 Creating dashboards with variables ....................................................................................................... 50 Types of dashboard variables ............................................................................................................ 51 Copying a variable to another dashboard ....................................................................................... 52 Tutorial: Using a regular expression pattern to switch between Regions ................................. 52 Tutorial: Creating dashboard with the Lambda function name as a variable ........................... 54 Using widgets on dashboards ................................................................................................................. 56 Adding a graph widget ...................................................................................................................... 58 Removing a graph widget ................................................................................................................... 60 Graph metrics manually on a dashboard ........................................................................................ 61 Editing a graph .................................................................................................................................... 62 Renaming a graph ................................................................................................................................ 69 Moving a graph ..................................................................................................................................... 69 Changing the size of graphs .............................................................................................................. 69 Changing the size of a graph temporarily ...................................................................................... 70 Add a metrics explorer widget ......................................................................................................... 70 Adding a line graph widget ................................................................................................................ 72 Removing a line graph ........................................................................................................................ 72 Adding a number widget .................................................................................................................... 72 Removing a number widget ............................................................................................................... 73 Adding a gauge widget ....................................................................................................................... 74 Removing a gauge widget .................................................................................................................. 74 Using a custom widget ........................................................................................................................ 75 Adding a text widget ........................................................................................................................... 86 Editing a text widget ........................................................................................................................... 86 Removing a text widget ...................................................................................................................... 87 Adding an alarm ................................................................................................................................... 87 iv Amazon CloudWatch User Guide Adding an alarm status widget ......................................................................................................... 87 Removing an alert widget .................................................................................................................. 88 Using a data table widget ................................................................................................................. 88 Linking graphs ....................................................................................................................................... 91 Unlinking graphs ................................................................................................................................... 92 Sharing dashboards ................................................................................................................................... 92 Permissions required to share a dashboard .................................................................................... 93 Permissions that are granted to people who you share the dashboard with ........................... 95 Sharing one dashboard with specific users ..................................................................................... 96 Sharing a dashboard publicly ............................................................................................................. 97 Sharing all dashboards using SSO .................................................................................................... 98 Setting up SSO ...................................................................................................................................... 99 Seeing how many of your dashboards are shared ...................................................................... 100 Seeing which dashboards are shared ............................................................................................. 100 Stopping dashboard sharing ............................................................................................................ 100 Reviewing and changing shared dashboard permissions ........................................................... 101 Allowing people that you share with to see composite alarms ................................................ 103 Allowing people that you share with to see logs table widgets ............................................... 104 Allowing people that you share with to see custom widgets ................................................... 105 Using live data .......................................................................................................................................... 106 Using live data for a dashboard ...................................................................................................... 107 Using live data for a widget ............................................................................................................ 107 |
acw-ug-002 | acw-ug.pdf | 2 | Sharing all dashboards using SSO .................................................................................................... 98 Setting up SSO ...................................................................................................................................... 99 Seeing how many of your dashboards are shared ...................................................................... 100 Seeing which dashboards are shared ............................................................................................. 100 Stopping dashboard sharing ............................................................................................................ 100 Reviewing and changing shared dashboard permissions ........................................................... 101 Allowing people that you share with to see composite alarms ................................................ 103 Allowing people that you share with to see logs table widgets ............................................... 104 Allowing people that you share with to see custom widgets ................................................... 105 Using live data .......................................................................................................................................... 106 Using live data for a dashboard ...................................................................................................... 107 Using live data for a widget ............................................................................................................ 107 Viewing an animated dashboard .......................................................................................................... 108 Add a dashboard to your favorites list .............................................................................................. 108 Changing the period override setting or refresh interval ................................................................ 109 Changing the time range or time zone format ................................................................................. 110 Metrics .......................................................................................................................................... 114 Concepts ..................................................................................................................................................... 114 Namespaces ......................................................................................................................................... 114 Metrics ................................................................................................................................................... 115 Dimensions ........................................................................................................................................... 117 Resolution ............................................................................................................................................. 118 Statistics ............................................................................................................................................... 119 Units ...................................................................................................................................................... 119 Periods .................................................................................................................................................. 119 Aggregation ......................................................................................................................................... 120 v Amazon CloudWatch User Guide Percentiles ............................................................................................................................................ 121 Alarms ................................................................................................................................................... 122 Basic and detailed monitoring .............................................................................................................. 123 Query metrics with CloudWatch Metrics Insights ............................................................................. 126 Building queries .................................................................................................................................. 127 Query components and syntax ........................................................................................................ 128 Alarms on queries .............................................................................................................................. 137 Use Metrics Insights queries with metric math ............................................................................ 141 Use natural language to generate and update CloudWatch Metrics Insights queries ........... 142 SQL inference ...................................................................................................................................... 146 Sample queries .................................................................................................................................... 148 Metrics Insights limits ........................................................................................................................ 156 Metrics Insights glossary ................................................................................................................... 157 Troubleshooting Metrics Insights .................................................................................................... 157 Use metrics explorer to monitor resources by their tags and properties ..................................... 158 CloudWatch agent configuration for metrics explorer ............................................................... 160 Use metric streams .................................................................................................................................. 161 Set up a metric stream ..................................................................................................................... 163 Statistics that can be streamed ....................................................................................................... 174 Metric stream operation and maintenance ................................................................................... 175 Monitoring your metric streams ...................................................................................................... 176 Trust between CloudWatch and Firehose ...................................................................................... 178 JSON output format .......................................................................................................................... 179 OpenTelemetry 1.0.0 output format .............................................................................................. 182 OpenTelemetry 0.7.0 output format .............................................................................................. 195 Troubleshooting metric streams in CloudWatch .......................................................................... 208 View available metrics ............................................................................................................................ 209 Search for available metrics ............................................................................................................. 212 Graphing metrics ...................................................................................................................................... 214 Graph a metric .................................................................................................................................... 215 Merge two graphs into one .............................................................................................................. 220 Use dynamic labels ............................................................................................................................ 221 Modify the time range or time zone format for a graph ........................................................... 224 Zooming in on a graph .................................................................................................................... 227 Modify the y-axis for a graph .......................................................................................................... 229 Create an alarm from a metric on a graph ................................................................................... 230 vi Amazon CloudWatch User Guide Using anomaly detection ....................................................................................................................... 232 How anomaly detection works ........................................................................................................ 234 Anomaly detection on metric math ............................................................................................... 235 Using math expressions with CloudWatch metrics ........................................................................... 236 Add a math expression to a CloudWatch graph .......................................................................... 236 Metric math syntax and functions .................................................................................................. 237 Using IF expressions ........................................................................................................................... 277 Anomaly detection on metric math ............................................................................................... 281 Use search expressions in graphs ......................................................................................................... 282 Search expression syntax .................................................................................................................. 282 Search expression examples ............................................................................................................. 289 Creating a graph with a search expression ................................................................................... 292 Get statistics for a metric ...................................................................................................................... 294 CloudWatch statistics definitions .................................................................................................... 294 Get statistics for a specific resource ............................................................................................... 299 Aggregate statistics across resources ............................................................................................. 304 Aggregate statistics by Auto Scaling group .................................................................................. 307 Aggregating statistics by AMI .......................................................................................................... 309 Publish custom metrics .......................................................................................................................... 311 High-resolution metrics ..................................................................................................................... 311 Use dimensions ................................................................................................................................... 312 Publish single data points ................................................................................................................ 313 Publish statistic sets .......................................................................................................................... 314 Publish the value zero ....................................................................................................................... 315 Stop publishing metrics ................................................................................................................... 315 Alarms .......................................................................................................................................... 316 Metric alarm states .................................................................................................................................. 317 Evaluating an alarm ................................................................................................................................ 317 Example of evaluating a multi-day alarm ..................................................................................... 320 Alarm actions ............................................................................................................................................ 320 Lambda alarm actions ....................................................................................................................... 321 Configuring how alarms treat missing data ....................................................................................... 325 How alarm state is evaluated when data is missing ................................................................... 327 High-resolution alarms ........................................................................................................................... 331 Alarms on math expressions ................................................................................................................. 331 Percentile-based alarms and low data samples ................................................................................ 331 vii Amazon CloudWatch User Guide Common features of CloudWatch alarms .......................................................................................... 332 Alarm recommendations for AWS services ........................................................................................ 333 Find and create recommended alarms .......................................................................................... 334 Recommended alarms ....................................................................................................................... 336 Alarming on metrics ................................................................................................................................ 443 Create an alarm based on a static threshold ............................................................................... 443 Create an alarm based on a metric math expression ................................................................. 445 Create an alarm based on a Metrics Insights query .................................................................... 448 Create an alarm based on a connected data source ................................................................... 449 Create an alarm based on anomaly detection .................................................................................. 452 Editing an anomaly detection model ........................................................................................... 456 Deleting an anomaly detection model .......................................................................................... 457 Alarming on logs ..................................................................................................................................... 458 Create an alarm based on a log group-metric filter ................................................................... 458 Combining alarms .................................................................................................................................... 460 Create a composite alarm ................................................................................................................. 463 Suppressing composite alarm actions .......................................................................................... 465 Acting on alarm changes ....................................................................................................................... 473 Notifying users on alarm changes .................................................................................................. 475 Alarm events and EventBridge ........................................................................................................ 482 Start an investigation in Amazon Q operational investigations from an alarm .......................... 496 Managing alarms |
acw-ug-003 | acw-ug.pdf | 3 | Create an alarm based on a connected data source ................................................................... 449 Create an alarm based on anomaly detection .................................................................................. 452 Editing an anomaly detection model ........................................................................................... 456 Deleting an anomaly detection model .......................................................................................... 457 Alarming on logs ..................................................................................................................................... 458 Create an alarm based on a log group-metric filter ................................................................... 458 Combining alarms .................................................................................................................................... 460 Create a composite alarm ................................................................................................................. 463 Suppressing composite alarm actions .......................................................................................... 465 Acting on alarm changes ....................................................................................................................... 473 Notifying users on alarm changes .................................................................................................. 475 Alarm events and EventBridge ........................................................................................................ 482 Start an investigation in Amazon Q operational investigations from an alarm .......................... 496 Managing alarms ...................................................................................................................................... 497 Editing or deleting a CloudWatch alarm ....................................................................................... 497 Hide Auto Scaling alarms ................................................................................................................. 499 Alarm use cases and examples ............................................................................................................. 500 Create a billing alarm ........................................................................................................................ 500 Create a CPU usage alarm ................................................................................................................ 504 Create a load balancer latency alarm ............................................................................................ 506 Create a storage throughput alarm ................................................................................................ 508 Create an alarm on Performance Insights counter metrics from an AWS database .............. 510 Create alarms to stop, terminate, reboot, or recover an EC2 instance .................................... 513 Alarms and tagging ................................................................................................................................. 521 Auditing telemetry configurations ............................................................................................. 523 Turning on telemetry auditing .............................................................................................................. 524 Auditing telemetry configurations for your organization .......................................................... 524 Turning on telemetry auditing for your account ......................................................................... 527 viii Amazon CloudWatch User Guide Deregistering a delegated administrator account ....................................................................... 527 Turning off trusted access for Organizations ............................................................................... 528 Viewing resources .................................................................................................................................... 528 Filtering discovered resources .......................................................................................................... 530 Changing preferences for Discovered resource page .................................................................. 531 Turning off telemetry auditing ............................................................................................................. 532 Infrastructure monitoring ........................................................................................................... 533 Container Insights .................................................................................................................................... 533 Supported platforms ......................................................................................................................... 534 Container Insights with enhanced observability for Amazon ECS ............................................ 534 Container Insights with enhanced observability for Amazon EKS ............................................ 535 CloudWatch agent container image ............................................................................................... 536 Setting up Container Insights .......................................................................................................... 536 Viewing Container Insights metrics ................................................................................................ 589 Metrics collected by Container Insights ......................................................................................... 592 Performance log reference ............................................................................................................... 703 Container Insights Prometheus metrics monitoring ................................................................... 739 Integration with Application Insights ............................................................................................. 868 Viewing Amazon ECS lifecycle events within Container Insights .............................................. 868 Troubleshooting Container Insights ................................................................................................ 870 Building your own CloudWatch agent Docker image ................................................................. 874 Deploying other CloudWatch agent features in your containers .............................................. 874 Lambda Insights ....................................................................................................................................... 875 Get started with Lambda Insights .................................................................................................. 875 Viewing your Lambda Insights metrics .......................................................................................... 955 Integration with Application Insights ............................................................................................. 956 Metrics collected by Lambda Insights ............................................................................................ 956 Troubleshooting and known issues ................................................................................................ 960 Example telemetry event .................................................................................................................. 961 Database Insights ..................................................................................................................................... 964 Modes .................................................................................................................................................... 964 Data retention ..................................................................................................................................... 966 Performance Insights ......................................................................................................................... 967 Pricing ................................................................................................................................................... 967 Get started ........................................................................................................................................... 967 Viewing the Fleet Health Dashboard ............................................................................................. 971 ix Amazon CloudWatch User Guide Viewing the Database Instance Dashboard ................................................................................... 978 Troubleshooting ................................................................................................................................ 1001 Use Contributor Insights to analyze high-cardinality data ........................................................... 1002 Create a Contributor Insights rule in CloudWatch .................................................................... 1003 Contributor Insights rule syntax in CloudWatch ........................................................................ 1008 Example rules .................................................................................................................................... 1012 Viewing Contributor Insights reports in CloudWatch ............................................................... 1016 Graphing metrics generated by rules in CloudWatch ............................................................... 1017 Using Contributor Insights built-in rules in CloudWatch ......................................................... 1020 CloudWatch Application Insights ....................................................................................................... 1021 What is Amazon CloudWatch Application Insights? ................................................................. 1022 How Application Insights works .................................................................................................... 1032 Prerequisites, IAM policies, and permissions .............................................................................. 1048 Set up application for monitoring ................................................................................................ 1052 Application Insights cross-account observability ....................................................................... 1082 Work with component configurations ......................................................................................... 1082 Use CloudFormation templates ..................................................................................................... 1154 Tutorial: Set up monitoring for SAP ASE .................................................................................... 1167 Tutorial: Set up monitoring for SAP HANA ................................................................................ 1176 Tutorial: Set up monitoring for SAP NetWeaver ....................................................................... 1192 View and troubleshoot Application Insights .............................................................................. 1210 Supported logs and metrics .......................................................................................................... 1214 Using the resource health view .......................................................................................................... 1311 Prerequisites ...................................................................................................................................... 1311 Application performance monitoring (APM) ........................................................................... 1314 Application Signals ................................................................................................................................ 1315 Permissions required for Application Signals ............................................................................. 1318 Supported systems .......................................................................................................................... 1325 Supported instrumentation setups .............................................................................................. 1329 Enable Application Signals in your account ............................................................................... 1330 (Optional) Try out Application Signals with a sample app ...................................................... 1331 Enable your applications on Amazon EKS clusters ................................................................... 1335 Enable your applications on Amazon EC2 .................................................................................. 1346 Enable your applications on Amazon ECS .................................................................................. 1361 Enable your applications on Kubernetes ..................................................................................... 1447 Enable your applications on Lambda .......................................................................................... 1455 x Amazon CloudWatch User Guide Troubleshooting your Application Signals installation ............................................................. 1486 (Optional) Configuring Application Signals ................................................................................ 1499 Monitor your application's operational health ........................................................................... 1507 Metrics collected by Application Signals ..................................................................................... 1552 Service level objectives (SLOs) ........................................................................................................... 1567 SLO concepts ..................................................................................................................................... 1568 Calculate error budget and attainment for period-based SLOs ............................................. 1570 Calculate error budget and attainment for request-based SLOs ........................................... 1571 Calculate burn rates and optionally set burn rate alarms ....................................................... 1572 Create an SLO ................................................................................................................................... 1577 View and triage SLO status ........................................................................................................... 1585 Edit an existing SLO ........................................................................................................................ 1587 Delete an SLO ................................................................................................................................... 1588 Transaction Search ................................................................................................................................ 1588 Benefits ............................................................................................................................................... 1589 How it works ..................................................................................................................................... 1590 Pricing ................................................................................................................................................. 1591 |
acw-ug-004 | acw-ug.pdf | 4 | 1486 (Optional) Configuring Application Signals ................................................................................ 1499 Monitor your application's operational health ........................................................................... 1507 Metrics collected by Application Signals ..................................................................................... 1552 Service level objectives (SLOs) ........................................................................................................... 1567 SLO concepts ..................................................................................................................................... 1568 Calculate error budget and attainment for period-based SLOs ............................................. 1570 Calculate error budget and attainment for request-based SLOs ........................................... 1571 Calculate burn rates and optionally set burn rate alarms ....................................................... 1572 Create an SLO ................................................................................................................................... 1577 View and triage SLO status ........................................................................................................... 1585 Edit an existing SLO ........................................................................................................................ 1587 Delete an SLO ................................................................................................................................... 1588 Transaction Search ................................................................................................................................ 1588 Benefits ............................................................................................................................................... 1589 How it works ..................................................................................................................................... 1590 Pricing ................................................................................................................................................. 1591 Getting started with Transaction Search .................................................................................... 1592 Spans ................................................................................................................................................... 1604 Adding custom attributes ............................................................................................................... 1614 Troubleshooting application issues .............................................................................................. 1617 Synthetic monitoring (canaries) ......................................................................................................... 1619 Required roles and permissions .................................................................................................... 1621 Creating a canary ............................................................................................................................. 1638 Groups ................................................................................................................................................. 1761 Test a canary locally ........................................................................................................................ 1762 Troubleshooting a failed canary ................................................................................................... 1815 Sample code for canary scripts ..................................................................................................... 1825 Canaries and X-Ray tracing ............................................................................................................ 1833 Running a canary on a VPC ........................................................................................................... 1834 Encrypting canary artifacts ............................................................................................................ 1836 Viewing canary statistics and details ........................................................................................... 1838 CloudWatch metrics published by canaries ................................................................................ 1840 Edit or delete a canary ................................................................................................................... 1844 Start, stop, delete, or update runtime for multiple canaries .................................................. 1846 Monitoring canary events with Amazon EventBridge .............................................................. 1846 xi Amazon CloudWatch User Guide Performing safe canary updates ................................................................................................... 1851 CloudWatch RUM ................................................................................................................................... 1855 IAM policies to use CloudWatch RUM .......................................................................................... 1859 Set up an application to use CloudWatch RUM ......................................................................... 1862 Using resource-based policies with CloudWatch RUM ............................................................. 1872 Configuring the CloudWatch RUM web client ........................................................................... 1874 Enabling unminification of JavaScript error stack traces ......................................................... 1875 Regionalization ................................................................................................................................. 1882 Use page groups .............................................................................................................................. 1883 Specify custom metadata ............................................................................................................... 1883 Send custom events ........................................................................................................................ 1889 Viewing the CloudWatch RUM dashboard .................................................................................. 1892 CloudWatch metrics that you can collect with CloudWatch RUM .......................................... 1895 Data protection and data privacy with CloudWatch RUM ....................................................... 1908 Information collected by the CloudWatch RUM web client .................................................... 1909 Manage your applications that use CloudWatch RUM ............................................................. 1942 CloudWatch RUM quotas ................................................................................................................ 1944 Troubleshooting ................................................................................................................................ 1944 Perform launches and A/B experiments with CloudWatch Evidently ......................................... 1945 IAM policies to use Evidently ........................................................................................................ 1947 Create projects, features, launches, and experiments .............................................................. 1949 Manage features, launches, and experiments ............................................................................ 1971 Adding code to your application .................................................................................................. 1978 Project data storage ........................................................................................................................ 1981 How Evidently calculates results .................................................................................................. 1984 View launch results in the dashboard ......................................................................................... 1987 View experiment results in the dashboard ................................................................................. 1987 How CloudWatch Evidently collects and stores data ............................................................... 1989 Using service-linked roles ............................................................................................................... 1990 Evidently quotas ............................................................................................................................... 1993 Tutorial: A/B testing with the Evidently sample application .................................................. 1994 Amazon Q Developer operational investigations (Preview) ................................................... 2005 AWS services where investigations are supported ......................................................................... 2008 Getting started ....................................................................................................................................... 2009 See a sample investigation ............................................................................................................ 2010 Set up operational investigations ................................................................................................. 2011 xii Amazon CloudWatch User Guide Investigate operational issues in your environment ...................................................................... 2017 Create an investigation ................................................................................................................... 2018 View and continue an open investigation ................................................................................... 2019 Reviewing and executing suggested runbook remediations ................................................... 2022 Manage your current investigations .................................................................................................. 2026 Restart an archived investigation ................................................................................................. 2027 Security in operational investigations ............................................................................................... 2027 User permissions .............................................................................................................................. 2028 How to control what data Amazon Q Developer has access to during investigations ........ 2029 Encryption of investigation data .................................................................................................. 2031 Cross-Region inference ................................................................................................................... 2038 Troubleshooting ..................................................................................................................................... 2039 Amazon Q Developer cannot assume the necessary IAM roles or permissions. Please verify required roles and permissions are correctly configured ......................................................... 2040 Unable to identify event source. Verify that the resource exists in your application topology and the resource type is supported. ........................................................................... 2040 Analysis complete. Submit additional findings to receive updated suggestions ................. 2040 Integrations with other systems ........................................................................................................ 2041 Integration with AWS Systems Manager Automation .............................................................. 2042 Third-party ticketing systems ........................................................................................................ 2042 Integration with third-party chat systems .................................................................................. 2043 AWS IAM Identity Center ................................................................................................................ 2045 (Recommended) Best practices to enhance investigations ........................................................... 2046 CloudWatch agent ............................................................................................................................ 2047 AWS CloudTrail ................................................................................................................................. 2047 CloudWatch Application Signals ................................................................................................... 2047 X-Ray ................................................................................................................................................... 2048 Container insights ............................................................................................................................ 2048 Operational investigation data retention ......................................................................................... 2048 Insights that Amazon Q Developer can surface in investigations ............................................... 2049 OpenTelemetry .......................................................................................................................... 2051 OTLP Endpoints ..................................................................................................................................... 2052 Traces endpoint ................................................................................................................................ 2052 Logs endpoint ................................................................................................................................... 2052 Endpoint limits and restrictions .................................................................................................... 2052 Getting started ....................................................................................................................................... 2057 xiii Amazon CloudWatch User Guide OpenTelemetry Collector Contrib ................................................................................................. 2058 Build your own custom OpenTelemetry Collector .................................................................... 2064 AWS Distro for OpenTelemetry ..................................................................................................... 2066 Troubleshooting ..................................................................................................................................... 2077 Network Monitoring .................................................................................................................. 2080 Using Network Flow Monitor .............................................................................................................. 2081 What is Network Flow Monitor? ................................................................................................... 2081 Get started ......................................................................................................................................... 2087 API operations ................................................................................................................................... 2088 Examples with the CLI .................................................................................................................... 2091 Install agents ..................................................................................................................................... 2103 Initialize Network Flow Monitor .................................................................................................... 2122 Monitor network flows .................................................................................................................... 2129 View CloudWatch metrics ............................................................................................................... 2136 Create alarms .................................................................................................................................... 2137 CloudTrail ........................................................................................................................................... 2139 |
acw-ug-005 | acw-ug.pdf | 5 | 2052 Logs endpoint ................................................................................................................................... 2052 Endpoint limits and restrictions .................................................................................................... 2052 Getting started ....................................................................................................................................... 2057 xiii Amazon CloudWatch User Guide OpenTelemetry Collector Contrib ................................................................................................. 2058 Build your own custom OpenTelemetry Collector .................................................................... 2064 AWS Distro for OpenTelemetry ..................................................................................................... 2066 Troubleshooting ..................................................................................................................................... 2077 Network Monitoring .................................................................................................................. 2080 Using Network Flow Monitor .............................................................................................................. 2081 What is Network Flow Monitor? ................................................................................................... 2081 Get started ......................................................................................................................................... 2087 API operations ................................................................................................................................... 2088 Examples with the CLI .................................................................................................................... 2091 Install agents ..................................................................................................................................... 2103 Initialize Network Flow Monitor .................................................................................................... 2122 Monitor network flows .................................................................................................................... 2129 View CloudWatch metrics ............................................................................................................... 2136 Create alarms .................................................................................................................................... 2137 CloudTrail ........................................................................................................................................... 2139 Troubleshoot issues ......................................................................................................................... 2139 Security ............................................................................................................................................... 2140 Quotas ................................................................................................................................................ 2152 Using Internet Monitor ......................................................................................................................... 2153 What is Internet Monitor? .............................................................................................................. 2153 Getting started ................................................................................................................................. 2172 Configure a monitor ........................................................................................................................ 2175 Examples with the CLI .................................................................................................................... 2190 Internet Monitor dashboard ........................................................................................................... 2200 Explore data using tools ................................................................................................................. 2212 Add a monitor with another AWS service ................................................................................... 2234 Create alarms .................................................................................................................................... 2240 EventBridge integration .................................................................................................................. 2242 Logs and metrics access errors ...................................................................................................... 2243 Data protection and data privacy ................................................................................................. 2244 Identity and Access Management ................................................................................................. 2244 Quotas ................................................................................................................................................ 2264 Using Network Synthetic Monitor ...................................................................................................... 2264 Key features ....................................................................................................................................... 2264 Terminology and components ....................................................................................................... 2265 xiv Amazon CloudWatch User Guide Requirements and limitations ....................................................................................................... 2265 How Network Synthetic Monitor works ...................................................................................... 2266 Supported AWS Regions ................................................................................................................. 2269 Pricing ................................................................................................................................................. 2270 API operations ................................................................................................................................... 2270 Working with monitors and probes ............................................................................................. 2271 Network Synthetic Monitor dashboards ...................................................................................... 2283 Probe alarms ..................................................................................................................................... 2290 Security ............................................................................................................................................... 2290 Identify and access management ................................................................................................. 2292 Quotas ................................................................................................................................................ 2310 CloudWatch observability solutions ........................................................................................ 2311 JVM workload on EC2 .......................................................................................................................... 2313 Requirements .................................................................................................................................... 2314 Benefits ............................................................................................................................................... 2314 Costs .................................................................................................................................................... 2315 CloudWatch agent configuration for this solution .................................................................... 2316 Deploy the agent for your solution ............................................................................................. 2320 Create the JVM solution dashboard ............................................................................................. 2324 NGINX workload on EC2 ...................................................................................................................... 2328 Requirements .................................................................................................................................... 2329 Benefits ............................................................................................................................................... 2329 Costs .................................................................................................................................................... 2330 CloudWatch agent configuration for this solution .................................................................... 2331 Deploy the agent for your solution ............................................................................................. 2337 Create the NGINX solution dashboard ........................................................................................ 2342 NVIDIA GPU workload on EC2 ............................................................................................................ 2344 Requirements .................................................................................................................................... 2345 Benefits ............................................................................................................................................... 2345 CloudWatch agent configuration for this solution .................................................................... 2348 Deploy the agent for your solution ............................................................................................. 2350 Create the NVIDIA GPU solution dashboard .............................................................................. 2354 Kafka workload on EC2 ........................................................................................................................ 2357 Requirements .................................................................................................................................... 2358 Benefits ............................................................................................................................................... 2358 Costs .................................................................................................................................................... 2361 xv Amazon CloudWatch User Guide CloudWatch agent configuration for this solution .................................................................... 2362 Deploy the agent for your solution ............................................................................................. 2369 Create the Kafka solution dashboard .......................................................................................... 2373 Configure the agent for multiple Kafka roles on the same instance ..................................... 2377 Tomcat workload on EC2 ..................................................................................................................... 2379 Requirements .................................................................................................................................... 2380 Benefits ............................................................................................................................................... 2380 Costs .................................................................................................................................................... 2383 CloudWatch agent configuration for this solution .................................................................... 2384 Deploy the agent for your solution ............................................................................................. 2388 Create the Tomcat solution dashboard ....................................................................................... 2392 EC2 health ............................................................................................................................................... 2396 Requirements .................................................................................................................................... 2396 Benefits ............................................................................................................................................... 2397 Costs .................................................................................................................................................... 2399 CloudWatch agent configuration for this solution .................................................................... 2400 Deploy the agent for your solution ............................................................................................. 2402 Create the EC2 Health solution dashboard ................................................................................ 2406 Get started with the EC2 Health solution dashboard .............................................................. 2408 Monitor across accounts and Regions ...................................................................................... 2410 CloudWatch cross-account observability .......................................................................................... 2413 Link monitoring accounts with source accounts ........................................................................ 2416 Manage monitoring accounts and source accounts .................................................................. 2428 Cross-account cross-Region CloudWatch console ........................................................................... 2431 Enabling cross-account cross-Region functionality ................................................................... 2432 (Optional) Integrate with AWS Organizations ............................................................................ 2436 Troubleshooting ................................................................................................................................ 2437 Disabling and cleaning up after using cross-account ............................................................... 2438 Explore related telemetry ......................................................................................................... 2439 What is related telemetry? .................................................................................................................. 2440 How to access ......................................................................................................................................... 2440 Navigating related telemetry .............................................................................................................. 2441 Using the topology map ...................................................................................................................... 2444 Finding a specific resource .................................................................................................................. 2444 Prerequisites ........................................................................................................................................... 2445 How does CloudWatch find related telemetry? .............................................................................. 2446 xvi Amazon CloudWatch User Guide Where does the entity data come from? .................................................................................... 2447 Where does service data come from? .......................................................................................... 2448 AWS services that support related telemetry ................................................................................. 2449 Add related information to custom telemetry ................................................................................ 2462 Entity KeyAttributes ........................................................................................................................ 2463 Entity Attributes ............................................................................................................................... 2465 Query metrics from other data sources ................................................................................... 2470 Managing access to data sources ..................................................................................................... 2471 Connect to a prebuilt data source with a wizard ........................................................................... 2472 Amazon Managed Service for Prometheus ............................................................................... 2473 Amazon OpenSearch Service ....................................................................................................... 2474 Amazon RDS for PostgreSQL and Amazon RDS for MySQL ................................................... 2474 Amazon S3 CSV files ...................................................................................................................... 2476 Microsoft Azure Monitor ............................................................................................................... 2477 Prometheus ...................................................................................................................................... 2478 Notification of Available Updates ............................................................................................... 2479 Create a custom connector to a data source ................................................................................... 2479 Use a template ................................................................................................................................ 2480 Create a custom data source from scratch ................................................................................ 2481 Use your custom data source ............................................................................................................. 2487 How to pass arguments to your Lambda function .................................................................. 2488 Delete a connector to a data source ................................................................................................. 2488 Collect metrics, logs, and traces with the CloudWatch agent ................................................ 2490 Install the |
acw-ug-006 | acw-ug.pdf | 6 | 2473 Amazon OpenSearch Service ....................................................................................................... 2474 Amazon RDS for PostgreSQL and Amazon RDS for MySQL ................................................... 2474 Amazon S3 CSV files ...................................................................................................................... 2476 Microsoft Azure Monitor ............................................................................................................... 2477 Prometheus ...................................................................................................................................... 2478 Notification of Available Updates ............................................................................................... 2479 Create a custom connector to a data source ................................................................................... 2479 Use a template ................................................................................................................................ 2480 Create a custom data source from scratch ................................................................................ 2481 Use your custom data source ............................................................................................................. 2487 How to pass arguments to your Lambda function .................................................................. 2488 Delete a connector to a data source ................................................................................................. 2488 Collect metrics, logs, and traces with the CloudWatch agent ................................................ 2490 Install the CloudWatch agent ............................................................................................................. 2493 Install the CloudWatch agent using the command line ........................................................... 2493 Install the CloudWatch agent using AWS Systems Manager ................................................... 2517 Install the CloudWatch agent on on-premises servers ............................................................. 2530 Install the CloudWatch agent on new instances using AWS CloudFormation ........................... 2536 Tutorial: Install using an AWS CloudFormation inline template ............................................. 2537 Tutorial: Install the CloudWatch agent using AWS CloudFormation and Parameter Store 2540 Troubleshooting installation of the CloudWatch agent with AWS CloudFormation ........... 2542 Set up the CloudWatch agent with security-enhanced Linux (SELinux) ..................................... 2542 Prerequisites ...................................................................................................................................... 2543 Configure SELinux for the agent .................................................................................................. 2544 CloudWatch agent credentials preference ....................................................................................... 2545 Verifying the signature of the CloudWatch agent package .......................................................... 2547 xvii Amazon CloudWatch User Guide Create the CloudWatch agent configuration file ............................................................................ 2557 Create the CloudWatch agent configuration file with the wizard .......................................... 2558 Manually create or edit the CloudWatch agent configuration file ......................................... 2565 Install the CloudWatch agent with the Amazon CloudWatch Observability EKS add-on or the Helm chart .............................................................................................................................................. 2705 Option 1: Install using EKS Pod Identity ................................................................................... 2706 Option 2: Install with IAM permissions on worker nodes ....................................................... 2710 Option 3: Install using IAM service account role (applies only to using the add-on) ......... 2712 Considerations for Amazon EKS Hybrid Nodes .......................................................................... 2715 (Optional) Additional configuration ............................................................................................. 2715 Troubleshooting ................................................................................................................................ 2725 Collect Java Management Extensions (JMX) metrics ................................................................ 2727 Enable Kueue metrics ...................................................................................................................... 2727 Appending OpenTelemetry collector configuration files ......................................................... 2731 Metrics collected by the CloudWatch agent .................................................................................... 2732 Metrics collected by the CloudWatch agent on Windows Server instances ......................... 2732 Metrics collected by the CloudWatch agent on Linux and macOS instances ....................... 2733 Memory metric definitions ............................................................................................................. 2748 Using the CloudWatch agent with related telemetry .................................................................... 2751 Common scenarios with the CloudWatch agent ............................................................................. 2752 Running the CloudWatch agent as a different user .................................................................. 2753 How the CloudWatch agent handles sparse log files ............................................................... 2755 Adding custom dimensions to metrics collected by the CloudWatch agent ........................ 2755 Multiple CloudWatch agent configuration files ......................................................................... 2756 Aggregating or rolling up metrics collected by the CloudWatch agent ................................ 2759 Collecting high-resolution metrics with the CloudWatch agent ............................................ 2760 Sending metrics, logs, and traces to a different account ......................................................... 2761 Timestamp differences between the unified CloudWatch agent and the earlier CloudWatch Logs agent ......................................................................................................................................... 2763 Appending OpenTelemetry collector configuration files ........................................................ 2763 Troubleshooting the CloudWatch agent ........................................................................................... 2764 CloudWatch agent command line parameters ........................................................................... 2765 Install the CloudWatch agent using Run Command fails ........................................................ 2765 The CloudWatch agent won't start .............................................................................................. 2766 Verify that the CloudWatch agent is running ............................................................................ 2766 The CloudWatch agent won't start, and the error mentions an Amazon EC2 Region ........ 2767 xviii Amazon CloudWatch User Guide The CloudWatch agent won't start on Windows Server .......................................................... 2767 Where are the metrics? ................................................................................................................... 2768 The CloudWatch agent takes a long time to run in a container or logs a hop limit error .. 2769 I updated my agent configuration but don’t see the new metrics or logs in the CloudWatch console ................................................................................................................................................ 2769 CloudWatch agent files and locations ......................................................................................... 2769 Finding information about CloudWatch agent versions .......................................................... 2772 Logs generated by the CloudWatch agent ................................................................................. 2772 Stopping and restarting the CloudWatch agent ....................................................................... 2773 Embedding metrics within logs ................................................................................................ 2775 Publishing logs with the embedded metric format ....................................................................... 2776 Using the client libraries ................................................................................................................ 2776 Specification: Embedded metric format ...................................................................................... 2777 Using the PutLogEvents API to send manually-created embedded metric format logs .... 2786 Using the CloudWatch agent to send embedded metric format logs ................................... 2788 Using the embedded metric format with AWS Distro for OpenTelemetry ........................... 2795 Viewing your metrics and logs in the console ................................................................................ 2796 Setting alarms on metrics created with the embedded metric format ...................................... 2797 Services that publish CloudWatch metrics .............................................................................. 2798 AWS usage metrics .................................................................................................................... 2815 Visualizing your service quotas and setting alarms ....................................................................... 2815 AWS API usage metrics ........................................................................................................................ 2817 CloudWatch usage metrics .................................................................................................................. 2826 CloudWatch tutorials ................................................................................................................. 2828 Scenario: Monitor estimated charges ................................................................................................ 2828 Step 1: Enable billing alerts .......................................................................................................... 2829 Step 2: Create a billing alarm ....................................................................................................... 2830 Step 3: Check the alarm status ..................................................................................................... 2831 Step 4: Edit a billing alarm ............................................................................................................ 2832 Step 5: Delete a billing alarm ....................................................................................................... 2832 Scenario: |
acw-ug-007 | acw-ug.pdf | 7 | logs in the console ................................................................................ 2796 Setting alarms on metrics created with the embedded metric format ...................................... 2797 Services that publish CloudWatch metrics .............................................................................. 2798 AWS usage metrics .................................................................................................................... 2815 Visualizing your service quotas and setting alarms ....................................................................... 2815 AWS API usage metrics ........................................................................................................................ 2817 CloudWatch usage metrics .................................................................................................................. 2826 CloudWatch tutorials ................................................................................................................. 2828 Scenario: Monitor estimated charges ................................................................................................ 2828 Step 1: Enable billing alerts .......................................................................................................... 2829 Step 2: Create a billing alarm ....................................................................................................... 2830 Step 3: Check the alarm status ..................................................................................................... 2831 Step 4: Edit a billing alarm ............................................................................................................ 2832 Step 5: Delete a billing alarm ....................................................................................................... 2832 Scenario: Publish metrics ..................................................................................................................... 2832 Step 1: Define the data configuration ......................................................................................... 2833 Step 2: Add metrics to CloudWatch ............................................................................................. 2834 Step 3: Get statistics from CloudWatch ...................................................................................... 2835 Step 4: View graphs with the console ......................................................................................... 2835 Working with AWS SDKs ........................................................................................................... 2837 xix Amazon CloudWatch User Guide Code examples ........................................................................................................................... 2839 Basics ........................................................................................................................................................ 2845 Hello CloudWatch ............................................................................................................................ 2845 Learn the basics ................................................................................................................................ 2850 Actions ................................................................................................................................................ 2945 Scenarios .................................................................................................................................................. 3098 Get started with alarms .................................................................................................................. 3099 Manage metrics and alarms ........................................................................................................... 3101 Monitor DynamoDB performance ................................................................................................. 3110 Security ...................................................................................................................................... 3111 Data protection ...................................................................................................................................... 3112 Encryption in transit ........................................................................................................................ 3113 Identity and access management ...................................................................................................... 3113 Audience ............................................................................................................................................. 3114 Authenticating with identities ....................................................................................................... 3114 Managing access using policies ..................................................................................................... 3117 How Amazon CloudWatch works with IAM ................................................................................ 3120 Identity-based policy examples ..................................................................................................... 3126 Troubleshooting ................................................................................................................................ 3131 CloudWatch dashboard permissions update .............................................................................. 3133 AWS managed (predefined) policies for CloudWatch ............................................................... 3134 Customer managed policy examples ........................................................................................... 3213 Policy updates ................................................................................................................................... 3215 Using condition keys to limit access to CloudWatch namespaces .......................................... 3246 Using condition keys to limit Contributor Insights users' access to log groups ................... 3247 Using condition keys to limit alarm actions ............................................................................... 3249 Using service-linked roles ............................................................................................................... 3249 Using a service-linked role for CloudWatch RUM ...................................................................... 3265 Using service-linked roles for Application Insights ................................................................... 3271 AWS managed policies for Application Insights ........................................................................ 3283 Amazon CloudWatch permissions reference .............................................................................. 3296 Compliance validation .......................................................................................................................... 3309 Resilience ................................................................................................................................................. 3310 Infrastructure security .......................................................................................................................... 3310 Network isolation ............................................................................................................................. 3311 AWS Security Hub ................................................................................................................................. 3311 xx Amazon CloudWatch User Guide Interface VPC endpoints ...................................................................................................................... 3312 CloudWatch ....................................................................................................................................... 3312 CloudWatch Synthetics ................................................................................................................... 3314 CloudWatch Network Monitoring ................................................................................................. 3316 Security considerations for Synthetics canaries .............................................................................. 3318 Use secure connections ................................................................................................................... 3319 Canary naming considerations ...................................................................................................... 3319 Secrets and sensitive information in canary code ..................................................................... 3319 Permissions considerations ............................................................................................................ 3319 Stack traces and exception messages .......................................................................................... 3320 Scope your IAM roles narrowly ..................................................................................................... 3320 Sensitive data redaction ................................................................................................................. 3321 Logging API and console operations with AWS CloudTrail ..................................................... 3323 CloudWatch information in CloudTrail ............................................................................................. 3325 Example: CloudWatch log file entries .......................................................................................... 3325 CloudWatch data events in CloudTrail .............................................................................................. 3328 Query generation information in CloudTrail ................................................................................... 3331 Amazon Q Developer operational investigations events in CloudTrail ....................................... 3333 Example: Amazon Q Developer operational investigations log file entries .......................... 3334 Network Flow Monitor in CloudTrail ................................................................................................. 3337 Example: Network Flow Monitor log file entry .......................................................................... 3338 Network Flow Monitor data plane events in CloudTrail ................................................................ 3341 Internet Monitor in CloudTrail ............................................................................................................ 3344 Example: Internet Monitor log file entries .................................................................................. 3345 CloudWatch Synthetics information in CloudTrail .......................................................................... 3347 Example: CloudWatch Synthetics log file entries ...................................................................... 3347 CloudWatch RUM information in CloudTrail .................................................................................... 3351 Example: CloudWatch RUM log file entries ................................................................................ 3351 CloudWatch RUM data plane events in CloudTrail ......................................................................... 3356 Tagging your CloudWatch resources ........................................................................................ 3359 Supported resources in CloudWatch ................................................................................................. 3359 Managing tags ........................................................................................................................................ 3360 Tag naming and usage conventions .................................................................................................. 3360 Grafana integration ................................................................................................................... 3361 Service quotas ........................................................................................................................... 3362 Document history ...................................................................................................................... 3372 xxi Amazon CloudWatch User Guide What is Amazon CloudWatch? Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time, and offers many tools to give you system-wide observability of your application performance, operational health, and resource utilization. Topics • Operational visibility with metrics, alarms, and dashboards • Application performance monitoring (APM) • Infrastructure monitoring • Collect, store, and query logs • Use the CloudWatch agent to gather metrics, logs, and traces from Amazon EC2 fleets • Cross-account monitoring • Solutions catalog • Network and internet monitoring • Billing and costs • Amazon CloudWatch resources Operational visibility with metrics, alarms, and dashboards Metrics collect and track key performance data at user-defined intervals. Many AWS services automatically report metrics into CloudWatch, and you can also publish custom metrics in CloudWatch from your applications. Dashboards offer a unified view of your resources and applications with visualizations of your metrics and logs in a single location. You can also share dashboards across accounts and Regions for enhanced operational awareness. CloudWatch provides curated automatic dashboards for many AWS services, so that you don't have to build them yourself. You can set up alarms that continuously monitor CloudWatch metrics against user-defined thresholds. They can automatically |
acw-ug-008 | acw-ug.pdf | 8 | and dashboards Metrics collect and track key performance data at user-defined intervals. Many AWS services automatically report metrics into CloudWatch, and you can also publish custom metrics in CloudWatch from your applications. Dashboards offer a unified view of your resources and applications with visualizations of your metrics and logs in a single location. You can also share dashboards across accounts and Regions for enhanced operational awareness. CloudWatch provides curated automatic dashboards for many AWS services, so that you don't have to build them yourself. You can set up alarms that continuously monitor CloudWatch metrics against user-defined thresholds. They can automatically alert you to breaches of the thresholds, and can also automatically respond to changes in your resources' behavior by triggering automated actions. Operational visibility with metrics, alarms, and dashboards 1 Amazon CloudWatch User Guide Application performance monitoring (APM) With Application Signals you can automatically detect and monitor your applications' key performance indicators like latency, error rates, and request rates without manual instrumentation or code changes. Application Signals also provides curated dashboards so you can begin monitoring with a minimum of setup. CloudWatch Synthetics complements this by enabling you to proactively monitor your endpoints and APIs through configurable scripts called canaries that simulate user behavior and alert you to availability issues or performance degradation before they impact real users. You can also use CloudWatch RUM to gather performance data from real user sessions. Use Service Level Objectives (SLOs) in CloudWatch to define, track, and alert on specific reliability targets for your applications, helping you maintain service quality commitments by setting error budgets and monitoring SLO compliance over time. Infrastructure monitoring Many AWS services automatically send basic metrics to CloudWatch for free. Services that send metrics are listed here. Additionally, CloudWatch provides additional monitoring capabilities for several key pieces of AWS infrastructure: • Database Insights allows you to monitor database performance metrics in real time, analyze SQL query performance, and troubleshoot database load issues for AWS database services. • Lambda Insights provides system-level metrics for Lambda functions, including memory and CPU utilization tracking, and cold start detection and analysis. • Container Insights allows you to collect and analyze metrics from containerized applications, on Amazon ECS clusters, Amazon EKS clusters, and self-managed Kubernetes clusters on Amazon EC2. Collect, store, and query logs CloudWatch Logs offers a suite of powerful features for comprehensive log management and analysis. Logs ingested from AWS services and custom applications are stored in log groups and streams for easy organization. Use CloudWatch Logs Insights to perform interactive, fast queries on your log data, with a choice of three query languages including SQL and PPL. Use log anomaly detection to find unusual patterns in log events in a log group, which can indicate issues. Create Application performance monitoring (APM) 2 Amazon CloudWatch User Guide metric filters to extract numerical values from logs and generate CloudWatch metrics, which you can use for alerting and dashboards. Set up subscription filters to process and analyze logs in real- time or route them to other services like Amazon S3 or Firehose. Use the CloudWatch agent to gather metrics, logs, and traces from Amazon EC2 fleets Use the CloudWatch agent to collect detailed system metrics about processes, CPU, memory, disk usage, and network performance from your fleets of Amazon EC2 instances and on-premises servers. You can also collect and monitor custom metrics from your applications, aggregate logs from multiple sources, and configure alarms based on the collected data. You can also use the agent to gather GPU metrics. The agent supports both Windows and Linux operating systems and can integrate with Systems Manager for centralized configuration management. Cross-account monitoring CloudWatch cross-account observability lets you set up a central monitoring account to monitor and troubleshoot applications that span multiple accounts. From the central account, you can view metrics, logs, and traces from source accounts across your organization. This centralized approach enables you to create cross-account dashboards, set up alarms that watch metrics from multiple accounts, and perform root-cause analysis across account boundaries. With CloudWatch cross- account observability, you can link source accounts either individually or link them automatically through AWS Organizations. Solutions catalog CloudWatch offers a catalog of readily available configurations to help you quickly implement monitoring for various AWS services and common workloads, such as Java Virtual Machines (JVM), NVIDIA GPU, Apache Kafka, Apache Tomcat, and NGINX. These solutions provide focused guidance, including instructions for installing and configuring the CloudWatch agent, deploying pre-defined custom dashboards, and setting up related alarms. Network and internet monitoring CloudWatch provides comprehensive network and internet monitoring capabilities through CloudWatch Network Monitoring. Use the CloudWatch agent to gather metrics, logs, and traces from Amazon EC2 fleets 3 Amazon CloudWatch User Guide Internet Monitor uses AWS global networking data to analyze internet performance and availability between your applications and end users. With |
acw-ug-009 | acw-ug.pdf | 9 | monitoring for various AWS services and common workloads, such as Java Virtual Machines (JVM), NVIDIA GPU, Apache Kafka, Apache Tomcat, and NGINX. These solutions provide focused guidance, including instructions for installing and configuring the CloudWatch agent, deploying pre-defined custom dashboards, and setting up related alarms. Network and internet monitoring CloudWatch provides comprehensive network and internet monitoring capabilities through CloudWatch Network Monitoring. Use the CloudWatch agent to gather metrics, logs, and traces from Amazon EC2 fleets 3 Amazon CloudWatch User Guide Internet Monitor uses AWS global networking data to analyze internet performance and availability between your applications and end users. With an internet monitor, you can identify or get notifications for increased latency or regional disruptions that impact your customers. Internet monitors work by analyzing your VPC flow logs to provide automated insights about network traffic patterns and performance. You can also get suggestions for how to optimize application performance for your clients. Network Flow Monitor displays network performance information gathered by lightweight software agents that you install on your instances. Using a flow monitor, you can quickly visualize packet loss and latency of your network connections over a time frame that you specify. Each monitor also generates a network health indicator (NHI), which tells you whether there were AWS network issues for the network flows tracked by your monitor during the time period that you're evaluating. When you connect by using AWS Direct Connect, you can use synthetic monitors in Network Synthetic Monitor to proactively monitor network connectivity by running synthetic tests between a VPC and on-premises endpoints. When you create a synthetic monitor, you specify probes by providing a VPC subnet and on-premises IP addresses. AWS creates and manages the infrastructure in the background that is required to perform round-trip time and packet loss measurements with the probes. These tests detect issues with connectivity, DNS, and latency before they impact your applications, so that you can take action to improve your end users’ experience. Billing and costs For complete information about CloudWatch pricing, see Amazon CloudWatch Pricing. For information that can help you analyze your bill and possibly optimize and reduce costs, see Analyzing, optimizing, and reducing CloudWatch costs. Amazon CloudWatch resources The following related resources can help you as you work with this service. Resource Description Amazon CloudWatch FAQs The FAQ covers the top questions developers have asked about this product. Billing and costs 4 Amazon CloudWatch Resource AWS Developer Center AWS Management Console User Guide Description A central starting point to find documentation, code examples, release notes, and other information to help you build innovative applications with AWS. The console allows you to perform most of the functions of Amazon CloudWatch and various other AWS offerings without programming. Amazon CloudWatch Discussion Forums Community-based forum for developers to discuss technical questions related to Amazon CloudWatch. AWS Support The hub for creating and managing your AWS Support cases. Also includes links to other helpful resources, such as forums, technical FAQs, service health status, and AWS Trusted Advisor. Amazon CloudWatch product i nformation The primary web page for information about Amazon CloudWatch. Contact Us A central contact point for inquiries concerning AWS billing, account, events, abuse, etc. Resources 5 Amazon CloudWatch User Guide Getting set up To use Amazon CloudWatch you need an AWS account. Your AWS account allows you to use services (for example, Amazon EC2) to generate metrics that you can view in the CloudWatch console, a point-and-click web-based interface. In addition, you can install and configure the AWS command line interface (CLI). Sign up for an AWS account If you do not have an AWS account, complete the following steps to create one. To sign up for an AWS account 1. Open https://portal.aws.amazon.com/billing/signup. 2. Follow the online instructions. Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad. When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access. AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the |
acw-ug-010 | acw-ug.pdf | 10 | after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account. Create a user with administrative access After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks. Secure your AWS account root user 1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. Sign up for an AWS account 6 Amazon CloudWatch User Guide For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide. 2. Turn on multi-factor authentication (MFA) for your root user. For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide. Create a user with administrative access 1. Enable IAM Identity Center. For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide. 2. In IAM Identity Center, grant administrative access to a user. For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide. Sign in as the user with administrative access • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user. For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide. Assign access to additional users 1. In IAM Identity Center, create a permission set that follows the best practice of applying least- privilege permissions. For instructions, see Create a permission set in the AWS IAM Identity Center User Guide. 2. Assign users to a group, and then assign single sign-on access to the group. For instructions, see Add groups in the AWS IAM Identity Center User Guide. Create a user with administrative access 7 Amazon CloudWatch User Guide Sign in to the Amazon CloudWatch console To sign in to the Amazon CloudWatch console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. If necessary, use the navigation bar to change the Region to the Region where you have your AWS resources. 3. Even if this is the first time you are using the CloudWatch console, Your Metrics could already report metrics, because you have used an AWS product that automatically pushes metrics to Amazon CloudWatch for free. Other services require that you enable metrics. If you do not have any alarms, the Your Alarms section will have a Create Alarm button. Set up the AWS CLI You can use the AWS CLI or the Amazon CloudWatch CLI to perform CloudWatch commands. Note that the AWS CLI replaces the CloudWatch CLI; we include new CloudWatch features only in the AWS CLI. For information about how to install and configure the AWS CLI, see Getting Set Up with the AWS Command Line Interface in the AWS Command Line Interface User Guide. For information about how to install and configure the Amazon CloudWatch CLI, see Set Up the Command Line Interface in the Amazon CloudWatch CLI Reference. Sign in to the Amazon CloudWatch console 8 Amazon CloudWatch User Guide Analyzing, optimizing, and reducing CloudWatch costs This section describes how Amazon CloudWatch features generate costs. It also provides methods that can help you analyze, optimize, and reduce CloudWatch costs. Throughout this section, we sometimes refer to pricing when describing CloudWatch features. For information about pricing, see Amazon CloudWatch pricing. Topics • Analyze CloudWatch cost and usage data with Cost Explorer • Analyze CloudWatch cost and usage data with AWS Cost and Usage Reports and Athena • Optimizing and reducing costs of CloudWatch metrics • Optimizing and reducing costs of CloudWatch alarms • Optimizing and reducing costs of CloudWatch Container Insights • Optimizing and reducing costs of CloudWatch Logs Analyze CloudWatch cost and usage data with Cost Explorer With AWS Cost Explorer, you can visualize and analyze cost and usage data for AWS services over time, including CloudWatch. For more information, see Getting started with AWS Cost Explorer. The following procedure describes how to use Cost Explorer to visualize and analyze CloudWatch cost and usage data. To visualize and analyze CloudWatch cost and usage data 1. Sign in to the Cost Explorer console at https://console.aws.amazon.com/cost-management/ home#/custom. 2. Under FILTERS, for Service, select CloudWatch. 3. For Group by, choose Usage Type. You can also group your results by other categories, such as the following: • API Operation – |
acw-ug-011 | acw-ug.pdf | 11 | Explorer With AWS Cost Explorer, you can visualize and analyze cost and usage data for AWS services over time, including CloudWatch. For more information, see Getting started with AWS Cost Explorer. The following procedure describes how to use Cost Explorer to visualize and analyze CloudWatch cost and usage data. To visualize and analyze CloudWatch cost and usage data 1. Sign in to the Cost Explorer console at https://console.aws.amazon.com/cost-management/ home#/custom. 2. Under FILTERS, for Service, select CloudWatch. 3. For Group by, choose Usage Type. You can also group your results by other categories, such as the following: • API Operation – See which API operations generated the most costs. • Region – See which Regions generated the most costs. Analyze CloudWatch cost and usage data with Cost Explorer 9 Amazon CloudWatch User Guide The following image shows an example of the costs that CloudWatch features generated over six months. To see which CloudWatch features generated the most costs, look at the values for UsageType. For example, EU-CW:GMD-Metrics represents the costs that CloudWatch bulk API requests generated. Note The strings for UsageType match specific features and Regions. For example, the first part of EU-CW:GMD-Metrics (EU) matches the Europe (Ireland) Region, and the second part of EU-CW:GMD-Metrics (GMD-Metrics) matches CloudWatch bulk API requests. The entire string for UsageType can be formatted as follows: <Region>-CW:<Feature> or <Region>-<Feature>. Some CloudWatch features such as logs and alarms also uses the Global Region to identify the Free Tier usage. For example, Global-DataScanned-Bytes represents free CloudWatch Logs data ingestion usage. To enhance readability, the strings for UsageType in the tables throughout this document have been shortened to their string suffixes. For example, EU-CW:GMD-Metrics is shortened to GMD-Metrics. The following table includes the names of each CloudWatch feature, lists the names of each sub- feature, and lists the strings for UsageType. To visualize and analyze CloudWatch cost and usage data 10 Amazon CloudWatch User Guide CloudWatch feature CloudWatch sub-feature CloudWatch metrics Custom metrics Detailed monitoring Embedded metrics CloudWatch API requests API requests Bulk (Get) Contributor Insights Bitmap image snapshot CloudWatch metric streams Metric streams CloudWatch dashboards Dashboard with 50 or fewer metrics UsageType MetricMonitorUsage MetricMonitorUsage MetricMonitorUsage Requests GMD-Metrics GIRR-Metrics GMWI-Metrics MetricStreamUsage DashboardsUsageHour- Basic Dashboard with more than 50 metrics DashboardsUsageHour CloudWatch alarms Standard (metric alarm) High resolution (metric alarm) Metrics Insights query alarm AlarmMonitorUsage HighResAlarmMonito rUsage MetricInsightAlarm Usage To visualize and analyze CloudWatch cost and usage data 11 Amazon CloudWatch User Guide CloudWatch feature CloudWatch sub-feature Composite (aggregated alarm) UsageType CompositeAlarmMoni torUsage Container Insights Enhanced observability for Amazon EKS ObservationUsage CloudWatch Application Signals CloudWatch custom logs Enhanced observability for Amazon ECS MetricsUsage Application Signals Application-Signals Collect (data ingestion for Standard log class) Collect (data ingestion for Infrequent Access log class) Analyze (query) Analyze (Live Tail) Store (archive) DataProcessing-Bytes DataProcessingIA-B ytes DataScanned-Bytes Logs-LiveTail TimedStorage-ByteHrs Detect and mask (data protection) DataProtection-Bytes CloudWatch vended logs Delivery (Amazon CloudWatch Logs Standard log class) VendedLog-Bytes Delivery (CloudWatch Logs Infrequent Access log class) VendedLogIA-Bytes To visualize and analyze CloudWatch cost and usage data 12 Amazon CloudWatch User Guide CloudWatch feature CloudWatch sub-feature UsageType S3-Egress-Bytes Delivery (Amazon S3) Delivery (Amazon S3) in Parquet format S3-Egress-InputBytes Delivery (Amazon Data Firehose) FH-Egress-Bytes Contributor Insights CloudWatch Logs (Rules) CloudWatch Logs (Events) Amazon DynamoDB (Rules) DynamoDB Events) Canaries (Synthetics) Run Evidently Events Analysis Units RUM Events ContributorInsight Rules ContributorInsight Events ContributorRulesMa naged ContributorEventsM anaged Canary-runs Evidently-event Evidently-eau RUM-event To visualize and analyze CloudWatch cost and usage data 13 Amazon CloudWatch User Guide CloudWatch feature CloudWatch sub-feature Network monitoring Network Synthetic Monitor Internet Monitor (monitored resources) Internet Monitor (monitored city networks) UsageType CWNMHybrid-Paid InternetMonitor-Mo nitoredResource InternetMonitor-Ci tyNetwork Analyze CloudWatch cost and usage data with AWS Cost and Usage Reports and Athena Another way to analyze CloudWatch cost and usage data is by using AWS Cost and Usage Reports with Amazon Athena. AWS Cost and Usage Reports contain a comprehensive set of cost and usage data. You can create reports that track your costs and usage, and you can publish these reports to an S3 bucket of your choice. You also can download and delete your reports from your S3 bucket. For more information, see What are AWS Cost and Usage Reports? in the AWS Cost and Usage Reports User Guide. Note There is no charge for using AWS Cost and Usage Reports. You only pay for storage when you publish your reports to Amazon Simple Storage Service (Amazon S3). For more information, see Quotas and restrictions in the AWS Cost and Usage Reports User Guide. Athena is a query service that you can use with AWS Cost and Usage Reports to analyze cost and usage data. You can query your reports in your S3 bucket without needing to download them first. For more information, see What is Amazon Athena? in the Amazon Athena User Guide. For more information, see What is |
acw-ug-012 | acw-ug.pdf | 12 | There is no charge for using AWS Cost and Usage Reports. You only pay for storage when you publish your reports to Amazon Simple Storage Service (Amazon S3). For more information, see Quotas and restrictions in the AWS Cost and Usage Reports User Guide. Athena is a query service that you can use with AWS Cost and Usage Reports to analyze cost and usage data. You can query your reports in your S3 bucket without needing to download them first. For more information, see What is Amazon Athena? in the Amazon Athena User Guide. For more information, see What is Amazon Athena? in the Amazon Athena User Guide. For information about pricing, see Amazon Athena pricing. Analyze CloudWatch cost and usage data with AWS Cost and Usage Reports and Athena 14 Amazon CloudWatch User Guide The following procedure describes the process for enabling AWS Cost and Usage Reports and integrating the service with Athena. The procedure contains two example queries that you can use to analyze CloudWatch cost and usage data. Note You can use any of the example queries in this document. All of the example queries in this document correspond to a database named costandusagereport, and show results for the month of April and the year 2022. You can change this information. However, before you run a query, make sure that the name of your database matches the name of the database in the query. To analyze cost and usage data with AWS Cost and Usage Reports and Athena 1. Enable AWS Cost and Usage Reports. For more information, see Creating cost and usage reports in the AWS Cost and Usage Reports User Guide. Tip When you create your reports, make sure to select Include resource IDs. Otherwise, your reports won't include the column line_item_resource_id. This line helps you further identify costs when analyzing cost and usage data. 2. Integrate AWS Cost and Usage Reports with Athena. For more information, see Setting up Athena using AWS CloudFormation templates in the AWS Cost and Usage Reports User Guide. 3. Query your cost and usage reports. Example of Athena query to show CloudWatch costs per month You can use the following query to show which CloudWatch features generated the most costs for a given month. SELECT CASE -- Metrics To analyze cost and usage data with AWS Cost and Usage Reports and Athena 15 Amazon CloudWatch User Guide WHEN line_item_usage_type LIKE '%%MetricMonitorUsage%%' THEN 'Metrics (Custom, Detailed monitoring management portal EMF)' WHEN line_item_usage_type LIKE '%%Requests%%' THEN 'Metrics (API Requests)' WHEN line_item_usage_type LIKE '%%GMD-Metrics%%' THEN 'Metrics (Bulk API Requests)' WHEN line_item_usage_type LIKE '%%MetricStreamUsage%%' THEN 'Metric Streams' -- Contributor Insights WHEN line_item_usage_type LIKE '%%Contributor%%' THEN 'Contributor Insights' -- Dashboard WHEN line_item_usage_type LIKE '%%DashboardsUsageHour%%' THEN 'Dashboards' -- Alarms WHEN line_item_usage_type LIKE '%%AlarmMonitorUsage%%' THEN 'Alarms (Standard)' WHEN line_item_usage_type LIKE '%%HighResAlarmMonitorUsage%%' THEN 'Alarms (High Resolution)' WHEN line_item_usage_type LIKE '%%MetricInsightAlarmUsage%%' THEN 'Alarms (Metrics Insights)' WHEN line_item_usage_type LIKE '%%CompositeAlarmMonitorUsage%%' THEN 'Alarms (Composite)' -- Container Insights with enhanced observability WHEN (line_item_usage_type LIKE '%%MetricsUsage%%' OR line_item_usage_type LIKE '% %ObservationUsage%%') THEN 'Container Insights (Enhanced Observability)' -- Logs WHEN line_item_usage_type LIKE '%%DataProcessing-Bytes%%' THEN 'Logs (Collect - Data Ingestion)' WHEN line_item_usage_type LIKE '%%DataProcessingIA-Bytes%%' THEN 'Infrequent Access Logs (Collect - Data Ingestion)' WHEN line_item_usage_type LIKE '%%DataProtection-Bytes%%' THEN 'Logs (Data Protection - Detect and Mask)' WHEN line_item_usage_type LIKE '%%TimedStorage-ByteHrs%%' THEN 'Logs (Storage - Archival)' WHEN line_item_usage_type LIKE '%%DataScanned-Bytes%%' THEN 'Logs (Analyze - Logs Insights queries)' WHEN line_item_usage_type LIKE '%%Logs-LiveTail%%' THEN 'Logs (Analyze - Logs Live Tail)' -- Vended Logs WHEN line_item_usage_type LIKE '%%VendedLog-Bytes%%' THEN 'Vended Logs (Delivered to CW)' WHEN line_item_usage_type LIKE '%%VendedLogIA-Bytes%%' THEN 'Vended Infrequent Access Logs (Delivered to CW)' WHEN line_item_usage_type LIKE '%%FH-Egress-Bytes%%' THEN 'Vended Logs (Delivered to Data Firehose)' WHEN (line_item_usage_type LIKE '%%S3-Egress%%') THEN 'Vended Logs (Delivered to S3)' -- Network Monitoring WHEN line_item_usage_type LIKE '%%CWNMHybrid-Paid%%' THEN 'Network Monitor' WHEN line_item_usage_type LIKE '%%InternetMonitor%%' THEN 'Internet Monitor' To analyze cost and usage data with AWS Cost and Usage Reports and Athena 16 Amazon CloudWatch -- Other User Guide WHEN line_item_usage_type LIKE '%%Application-Signals%%' THEN 'Application Signals' WHEN line_item_usage_type LIKE '%%Canary-runs%%' THEN 'Synthetics' WHEN line_item_usage_type LIKE '%%Evidently%%' THEN 'Evidently' WHEN line_item_usage_type LIKE '%%RUM-event%%' THEN 'RUM' ELSE 'Others' END AS UsageType, -- REGEXP_EXTRACT(line_item_resource_id,'^(?:.+?:){5}(.+)$',1) as ResourceID, SUM(CAST(line_item_usage_amount AS double)) AS UsageQuantity, SUM(CAST(line_item_unblended_cost AS decimal(16,8))) AS TotalSpend FROM costandusagereport WHERE product_product_name = 'AmazonCloudWatch' AND year='2022' AND month='4' AND line_item_line_item_type NOT IN ('Tax','Credit','Refund','EdpDiscount','Fee','RIFee') -- AND line_item_usage_account_id = '123456789012' – If you want to filter on a specific account, you can remove this comment at the beginning of the line and specify an AWS account. GROUP BY 1 ORDER BY TotalSpend DESC, UsageType; Example of Athena query to show how CloudWatch features generated costs You can use the following query to show the results for UsageType and Operation. This shows you how CloudWatch features generated costs. The results also show the values for UsageQuantity and TotalSpend, so that you can |
acw-ug-013 | acw-ug.pdf | 13 | costandusagereport WHERE product_product_name = 'AmazonCloudWatch' AND year='2022' AND month='4' AND line_item_line_item_type NOT IN ('Tax','Credit','Refund','EdpDiscount','Fee','RIFee') -- AND line_item_usage_account_id = '123456789012' – If you want to filter on a specific account, you can remove this comment at the beginning of the line and specify an AWS account. GROUP BY 1 ORDER BY TotalSpend DESC, UsageType; Example of Athena query to show how CloudWatch features generated costs You can use the following query to show the results for UsageType and Operation. This shows you how CloudWatch features generated costs. The results also show the values for UsageQuantity and TotalSpend, so that you can see your total usage costs. Tip For more information about UsageType, add the following line to this query: line_item_line_item_description This line creates a column called Description. SELECT bill_payer_account_id as Payer, line_item_usage_account_id as LinkedAccount, To analyze cost and usage data with AWS Cost and Usage Reports and Athena 17 Amazon CloudWatch User Guide line_item_usage_type AS UsageType, line_item_operation AS Operation, line_item_resource_id AS ResourceID, SUM(CAST(line_item_usage_amount AS double)) AS UsageQuantity, SUM(CAST(line_item_unblended_cost AS decimal(16,8))) AS TotalSpend FROM costandusagereport WHERE product_product_name = 'AmazonCloudWatch' AND year='2022' AND month='4' AND line_item_line_item_type NOT IN ('Tax','Credit','Refund','EdpDiscount','Fee','RIFee') GROUP BY bill_payer_account_id, line_item_usage_account_id, line_item_usage_type, line_item_resource_id, line_item_operation Optimizing and reducing costs of CloudWatch metrics Many AWS services, such as Amazon Elastic Compute Cloud (Amazon EC2) , Amazon S3, and Amazon Data Firehose, automatically send metrics to CloudWatch at no charge. However, metrics that are grouped in the following categories can incur additional costs: • Custom metrics, detailed monitoring, and embedded metrics • API requests • Metric streams For more information, see Using Amazon CloudWatch metrics. Custom metrics You can create custom metrics to organize data points in any order and at any rate. All custom metrics are prorated by the hour. They're metered only when they're sent to CloudWatch. For information about how metrics are priced, see Amazon CloudWatch Pricing. Optimizing and reducing costs of CloudWatch metrics 18 Amazon CloudWatch User Guide The following table lists the names of relevant sub-features for CloudWatch metrics. The table includes the strings for UsageType and Operation, which can help you analyze and identify metric-related costs. Note To get more details about the metrics that are listed in the following table while you're querying cost and usage data with Athena, match the strings for Operation with the results that are shown for line_item_operation. CloudWatch sub-f eature UsageType Operation Purpose Custom metrics MetricMon itorUsage Detailed monitoring MetricMon itorUsage MetricStorage Custom metrics MetricSto rage:AWS/ {Service} Detailed monitoring Embedded metrics MetricMon itorUsage MetricSto rage:AWS/Logs- Logs embedded metrics EMF MetricSto rage:AWS/ CloudWatchLogs Log group metric filters Log filters MetricMon itorUsage Detailed monitoring CloudWatch has two types of monitoring: • Basic monitoring Basic monitoring is free and automatically enabled for all AWS services that support the feature. • Detailed monitoring Detailed monitoring 19 Amazon CloudWatch User Guide Detailed monitoring incurs costs and adds different enhancements depending on the AWS service. For each AWS service that supports detailed monitoring, you can choose whether to enable it for that service. For more information, see Basic and detailed monitoring. Note Other AWS services support detailed monitoring and might refer to this feature using a different name. For example, detailed monitoring for Amazon S3 is referred to as request metrics. Similar to custom metrics, detailed monitoring is prorated by the hour and metered only when data is sent to CloudWatch. Detailed monitoring generates costs by the number of metrics that are sent to CloudWatch. To reduce costs, only enable detailed monitoring when necessary. For information about how detailed monitoring is priced, see Amazon CloudWatch Pricing. Example: Athena query You can use the following query to show which EC2 instances have detailed monitoring enabled. SELECT bill_payer_account_id as Payer, line_item_usage_account_id as LinkedAccount, line_item_usage_type AS UsageType, line_item_operation AS Operation, line_item_resource_id AS ResourceID, SUM(CAST(line_item_usage_amount AS double)) AS UsageQuantity, SUM(CAST(line_item_unblended_cost AS decimal(16,8))) AS TotalSpend FROM costandusagereport WHERE product_product_name = 'AmazonCloudWatch' AND year='2022' AND month='4' AND line_item_operation='MetricStorage:AWS/EC2' AND line_item_line_item_type NOT IN ('Tax','Credit','Refund','EdpDiscount','Fee','RIFee') GROUP BY bill_payer_account_id, line_item_usage_account_id, Detailed monitoring 20 Amazon CloudWatch line_item_usage_type, line_item_resource_id, line_item_operation, line_item_line_item_description ORDER BY line_item_operation Embedded metrics User Guide With the CloudWatch embedded metric format, you can ingest application data as log data, so that you can generate actionable metrics. For more information, see Ingesting high-cardinality logs and generating metrics with the CloudWatch embedded metric format. Embedded metrics generate costs by the number of logs ingested, number of logs archived, and number of custom metrics generated. The following table lists the names of relevant sub-features for the CloudWatch embedded metric format. The table includes the strings for UsageType and Operation, which can help you analyze and identify costs. CloudWatch subfeature Custom metrics UsageType Operation Purpose MetricMon itorUsage MetricSto rage:AWS/Logs- EMF Logs ingestion DataProcessing- PutLogEvents Bytes Logs archival TimedStorage- HourlySto ByteHrs rageMetering Logs embedded metrics Uploads a batch of log events to the specified log group or log stream Stores logs |
acw-ug-014 | acw-ug.pdf | 14 | with the CloudWatch embedded metric format. Embedded metrics generate costs by the number of logs ingested, number of logs archived, and number of custom metrics generated. The following table lists the names of relevant sub-features for the CloudWatch embedded metric format. The table includes the strings for UsageType and Operation, which can help you analyze and identify costs. CloudWatch subfeature Custom metrics UsageType Operation Purpose MetricMon itorUsage MetricSto rage:AWS/Logs- EMF Logs ingestion DataProcessing- PutLogEvents Bytes Logs archival TimedStorage- HourlySto ByteHrs rageMetering Logs embedded metrics Uploads a batch of log events to the specified log group or log stream Stores logs per hour and logs per byte in CloudWatch Logs To analyze costs, use AWS Cost and Usage Reports with Athena so that you can identify which metrics are generating costs and determine how the costs are generated. Embedded metrics 21 Amazon CloudWatch User Guide To make the most of costs generated by the CloudWatch embedded metric format, avoid creating metrics based on high-cardinality dimensions. This way, CloudWatch doesn't create a custom metric for each unique dimension combination. For more information, see Dimensions. API requests CloudWatch has the following types of API requests: • API requests • Bulk (Get) • Contributor Insights • Bitmap image snapshot API requests generate costs by the request type and number of metrics requested. The following table lists the types of API requests and includes the strings for UsageType and Operation, which can help you analyze and identify API-related costs. API request type UsageType Operation Purpose API requests Requests GetMetric Statistics Retrieves statistics for the specified metrics Requests ListMetrics Requests PutMetricData Requests GetDashboard Requests ListDashboards Lists the specified metrics Publishes metric data points to Clou dWatch Displays details for the specified dashbo ards Lists the dashboards in your account API requests 22 Amazon CloudWatch User Guide API request type UsageType Operation Purpose Requests PutDashboard Creates or updates a dashboard Requests DeleteDas hboards Deletes all specified dashboards Bulk (Get) GMD-Metrics GetMetricData Contributor Insights GIRR-Metrics GetInsigh tRuleReport Bitmap image snapshot GMWI-Metrics GetMetric WidgetImage Retrieves CloudWatch metric values Returns time-series data that's collected by a Contributor Insights rule Retrieves a snapshot of one or more CloudWatch metrics as a bitmap image To analyze costs, use Cost Explorer, and group your results by API Operation. Costs for API requests vary, and you incur costs when you exceed the number of API calls provided to you under the AWS Free Tier limit. Note GetMetricData and GetMetricWidgetImage aren't included under the AWS Free Tier limit. For more information, see Using the AWS Free Tier in the AWS Billing User Guide. The API requests that typically drive cost are Put and Get requests. PutMetricData PutMetricData generates costs every time that it's called and can incur significant costs depending on the use case. For more information, see PutMetricData in the Amazon CloudWatch API Reference. API requests 23 Amazon CloudWatch User Guide To make the most of costs that are generated by PutMetricData, batch more data into your API calls. Depending on your use case, consider using CloudWatch Logs or the CloudWatch embedded metric format to inject metric data. For more information, see the following resources: • What is Amazon CloudWatch Logs? in the Amazon CloudWatch Logs User Guide • Ingesting high-cardinality logs and generating metrics with CloudWatch embedded metric format • Lowering costs and focusing on our customers with Amazon CloudWatch embedded custom metrics GetMetricData GetMetricData can also generate significant costs. Common use cases that drive cost involve third-party monitoring tools that pull data to generate insights. For more information, see GetMetricData in the Amazon CloudWatch API Reference. To reduce costs generated by GetMetricData, consider only pulling data that's monitored and used, or consider pulling data less often. Depending on your use case, you might consider using metric streams instead of GetMetricData, so that you can push data in near real time to third parties at a lower cost. For more information, see the following resources: • Using metric streams • CloudWatch Metric Streams - Send AWS Metrics to Partners and to Your Apps in Real Time GetMetricStatistics Depending on your use case, you might consider using GetMetricStatistics instead of GetMetricData. With GetMetricData, you can retrieve data quickly and at scale. However, GetMetricStatistics is included under the AWS Free Tier limit for up to one million API requests, which can help you reduce costs if you don't need to retrieve as many metrics and data points per call. For more information, see the following resources: • GetMetricStatistics in the Amazon CloudWatch API Reference • Should I use GetMetricData or GetMetricStatistics? API requests 24 Amazon CloudWatch Note User Guide External callers make API calls. For APIs that are supported by CloudTrail data events (such as GetMetricData and GetMetricWidgetImage), you can use CloudTrail to identify the top CloudWatch API callers and potentially mitigate or identify unexpected |
acw-ug-015 | acw-ug.pdf | 15 | included under the AWS Free Tier limit for up to one million API requests, which can help you reduce costs if you don't need to retrieve as many metrics and data points per call. For more information, see the following resources: • GetMetricStatistics in the Amazon CloudWatch API Reference • Should I use GetMetricData or GetMetricStatistics? API requests 24 Amazon CloudWatch Note User Guide External callers make API calls. For APIs that are supported by CloudTrail data events (such as GetMetricData and GetMetricWidgetImage), you can use CloudTrail to identify the top CloudWatch API callers and potentially mitigate or identify unexpected calls. For more information, see How to use CloudTrail to analyse your CloudWatch API Usage. For other CloudWatch APIs not supported by CloudTrail, you can open a technical support request to the CloudWatch team and ask for information about them. For information about creating a technical support request, see How do I get technical support from AWS?. CloudWatch metric streams With CloudWatch metric streams, you can send metrics continuously to AWS destinations and third-party service provider destinations. Metric streams generate costs by the number of metric updates. Metric updates always include values for the following statistics: • Minimum • Maximum • Sample Count • Sum For more information, see Statistics that can be streamed. To analyze costs that are generated by CloudWatch metric streams, use AWS Cost and Usage Reports with Athena. This way, you can identify which metric streams are generating costs and determine how the costs are generated. Example: Athena query You can use the following query to track which metric streams generate costs by Amazon Resource Name (ARN). SELECT SPLIT_PART(line_item_resource_id,'/',2) AS "Stream Name", line_item_resource_id as ARN, CloudWatch metric streams 25 Amazon CloudWatch User Guide SUM(CAST(line_item_unblended_cost AS decimal(16,2))) AS TotalSpend FROM costandusagereport WHERE product_product_name = 'AmazonCloudWatch' AND year='2022' AND month='4' AND line_item_line_item_type NOT IN ('Tax','Credit','Refund','EdpDiscount','Fee','RIFee') -- AND line_item_usage_account_id = '123456789012' – If you want to filter on a specific account, you can remove this comment at the beginning of the line and specify an AWS account. AND line_item_usage_type LIKE '%%MetricStreamUsage%%' GROUP BY line_item_resource_id ORDER BY TotalSpend DESC To reduce costs generated by CloudWatch metric streams, stream only the metrics that bring your business value. You also can stop or pause any metric stream that you're not using. Optimizing and reducing costs of CloudWatch alarms With CloudWatch alarms, you can create alarms based on a single metric, alarms based on a Metrics Insights query, and composite alarms which watch other alarms. Note Costs for metric and composite alarms are prorated by the hour. You incur costs for your alarms only while your alarms exist. To optimize cost, be sure not to leave behind misconfigured or low-value alarms. To help with this, you can automate the cleanup of CloudWatch alarms that you no longer need. For more information, see Automating Amazon CloudWatch Alarm Cleanup at Scale Metric alarms Metric alarms have the following resolution settings: • Standard (evaluated every 60 seconds) • High resolution (evaluated every 10 seconds) Optimizing and reducing costs of CloudWatch alarms 26 Amazon CloudWatch User Guide When you create a metric alarm, your costs are based on your alarm’s resolution setting and the number of metrics that your alarm references. For example, a metric alarm that references one metric incurs one alarm-metric cost per hour. For more information, see Using Amazon CloudWatch alarms. If you create a metric alarm that contains a metric math expression, which references multiple metrics, you incur a cost for each alarm-metric that’s referenced in the metric math expression. For information about how to create a metric alarm that contains a metric math expression, see Creating a CloudWatch alarm based on a metric math expression. If you create an anomaly detection alarm, where your alarm analyzes past metric data to create a model of expected values, you incur a cost for each alarm-metric that's referenced in your alarm plus two additional metrics, one for the upper and lower band metrics that the anomaly detection model creates. For information about how to create an anomaly detection alarm, see Creating a CloudWatch alarm based on anomaly detection. Metrics Insights query alarms Metric Insights query alarms are a specific type of metric alarm, only available with standard resolution (evaluated every 60 seconds). When you create a Metric Insights query alarm, your costs are based on the number of metrics analyzed by the query that your alarm references. For example, a Metric Insights query alarm that references a query whose filter matches ten metrics incurs ten metrics analyzed cost per hour. For more information, see the pricing example on Amazon CloudWatch Pricing. If you create an alarm that contains both a Metrics Insights query and a metric math expression, it is reported as a Metrics Insights query alarm. If your alarm contains a metric math expression |
acw-ug-016 | acw-ug.pdf | 16 | with standard resolution (evaluated every 60 seconds). When you create a Metric Insights query alarm, your costs are based on the number of metrics analyzed by the query that your alarm references. For example, a Metric Insights query alarm that references a query whose filter matches ten metrics incurs ten metrics analyzed cost per hour. For more information, see the pricing example on Amazon CloudWatch Pricing. If you create an alarm that contains both a Metrics Insights query and a metric math expression, it is reported as a Metrics Insights query alarm. If your alarm contains a metric math expression which references other metrics in addition to the metrics analyzed by the Metrics Insights query, you incur an additional cost for each alarm-metric that’s referenced in the metric math expression. For information about how to create a metric alarm that contains a metric math expression, see Creating a CloudWatch alarm based on a metric math expression. Composite alarms Composite alarms contain rule expressions that specify how they should evaluate the states of other alarms to determine their own states. Composite alarms incur a standard cost per hour, regardless of how many other alarms they evaluate. Alarms that composite alarms reference in rule expressions incur separate costs. For more information, see Creating a composite alarm. Metrics Insights query alarms 27 Amazon CloudWatch Alarm usage types User Guide The following table lists the names of relevant sub-features for CloudWatch alarms. The table includes the strings for UsageType, which can help you analyze and identify alarm-related costs. CloudWatch sub-feature UsageType Standard metric alarm AlarmMonitorUsage High-resolution metric alarm HighResAlarmMonitorUsage Metrics Insights query alarm MetricInsightAlarmUsage Composite alarm CompositeAlarmMonitorUsage Reducing alarm costs To optimize costs generated by metric math alarms that aggregate four or more metrics, you can aggregate data before the data is sent to CloudWatch. This way, you can create an alarm for a single metric instead of an alarm that aggregates data for multiple metrics. For more information, see Publishing custom metrics. To optimize costs generated by Metrics Insights query alarms, you can ensure that the filter used for the query matches only the metrics that you want to monitor. The best way to reduce costs is to remove all unnecessary or unused alarms. For example, you can delete alarms that evaluate metrics emitted by AWS resources that no longer exist. Example of using DescribeAlarms to check for alarms in INSUFFICIENT_DATA state If you delete a resource, but not the metric alarms that the resource emits, the alarms still exist and typically will go into the INSUFFICIENT_DATA state. To check for alarms that are in the INSUFFICIENT_DATA state, use the following AWS Command Line Interface (AWS CLI) command. aws cloudwatch describe-alarms –state-value INSUFFICIENT_DATA For more information, see Automating Amazon CloudWatch Alarm Cleanup at Scale. Other ways to reduce costs include the following: Composite alarms 28 Amazon CloudWatch User Guide • Make sure to create alarms for the correct metrics. • Make sure that you don't have any alarms enabled in Regions where you're not working. • Remember that, although composite alarms reduce noise, they also generate additional costs. • When deciding whether to create a standard alarm or high-resolution alarm, consider your use case and the value that each type of alarm brings. Optimizing and reducing costs of CloudWatch Container Insights CloudWatch Container Insights offers both standard and enhanced observability features for monitoring containerized applications in Amazon ECS and Amazon EKS. CloudWatch Container Insights leverages the embedded metric format to ingest telemetry from your container environments. Container Insights with standard observability: Standard Container Insights collects and visualizes metrics aggregated at the cluster and node levels. You can get started with standard mode of Container Insights using either the CloudWatch agent or the AWS Distro for Open Telemetry (ADOT). Using ADOT enables you to customize which metrics and dimensions are sent to CloudWatch. Metrics in Container Insights are treated as "embedded metrics". Costs associated with these metrics are reflected in the usage types MetricStorage:AWS/Logs-EMF and DataProcessing- Bytes. For detailed pricing information, see the Embedded Metrics section at Amazon CloudWatch pricing. Container Insights with enhanced observability: Detailed visibility comes with Container Insights with enhanced observability, which delivers granular telemetry up to the pod and container levels in your applications. Similar to standard Container Insights, enhanced observability also comes with a standard set of critical metrics where you can get started by using the CloudWatch Observability add-on running on the CloudWatch agent. Container Insights offers enhanced observability with a new observation-based pricing in order to ensure cost effective bills justifying the benefit. See Amazon CloudWatch pricing for more information. Here are the following UsageType and Operation associated with this Container Inisghts with enhanced observability: Optimizing and reducing costs of CloudWatch Container Insights 29 Amazon CloudWatch User Guide CloudWatch sub-feature UsageType Operation Container Insights with enhanced observability |
acw-ug-017 | acw-ug.pdf | 17 | levels in your applications. Similar to standard Container Insights, enhanced observability also comes with a standard set of critical metrics where you can get started by using the CloudWatch Observability add-on running on the CloudWatch agent. Container Insights offers enhanced observability with a new observation-based pricing in order to ensure cost effective bills justifying the benefit. See Amazon CloudWatch pricing for more information. Here are the following UsageType and Operation associated with this Container Inisghts with enhanced observability: Optimizing and reducing costs of CloudWatch Container Insights 29 Amazon CloudWatch User Guide CloudWatch sub-feature UsageType Operation Container Insights with enhanced observability for Amazon EKS Container Insights with enhanced observability for Amazon ECS ObservationUsage ObservationCount:CI- EKScode MetricsUsage MetricStorage:CI-ECS Optimizing and reducing costs of CloudWatch Logs Amazon CloudWatch Logs has the following log types: • Custom logs (logs that you create for your applications) • Vended logs (logs that other AWS services, such as Amazon Virtual Private Cloud (Amazon VPC) and Amazon Route 53, create on your behalf) For more information about vended logs, see Enabling logging from certain AWS services in the Amazon CloudWatch Logs User Guide. Custom and vended logs generate costs based on the number of logs that are collected, stored, and analyzed. Separately, vended logs generate costs for delivery to Amazon S3 and Firehose. The following table lists the names of the CloudWatch Logs features and names of relevant sub- features. The table includes the strings for UsageType and Operation, which can help you analyze and identify log-related costs. CloudWatch Logs feature CloudWatch Logs sub-featu UsageType Operation Purpose Custom logs re Collect (data ingestion for Standard log class) DataProce PutLogEve ssing-Byt nts es Uploads a batch of logs to a specific log stream in a Optimizing and reducing costs of CloudWatch Logs 30 Amazon CloudWatch User Guide CloudWatch Logs feature CloudWatch Logs sub-featu re UsageType Operation Purpose Collect (data ingestion for Infrequent Access log class) DataProce PutLogEve ssingIA-B nts ytes Detect and mask (data protection) DataProte PutLogEve ction-Byt nts es Store (archive) TimedStor HourlySto age-ByteH rageMeter rs ing Analyze (Logs Insights queries) DataScann StartQuery ed-Bytes Analyze (Logs Live Tail) Logs-Live StartLive Tail Tail Standard class log group. Uploads a batch of logs to a specific log stream in an Infrequent Access class log group. Detects and masks protected data in log events. Stores logs per hour and logs per byte in CloudWatch Logs. Logs data scanned by CloudWatch Logs Insights queries Logs analyzed during a CloudWatch Logs Live Tail session Optimizing and reducing costs of CloudWatch Logs 31 Amazon CloudWatch User Guide CloudWatch Logs feature CloudWatch Logs sub-featu UsageType Operation Purpose Vended logs re Delivery (CloudWatch Logs Standard log class) Delivery (CloudWatch Logs Infrequent Access log class) VendedLog- PutLogEve Bytes nts VendedLog PutLogEve IA-Bytes nts Delivery (Amazon S3) S3-Egress- Bytes LogDelivery Delivery (Amazon S3) in Parquet format S3-Egress- InputBytes ParquetCo nversion Delivery (Firehose) FH-Egress- LogDelivery Bytes Uploads a batch of logs to a specific log stream in a log group in the Standard log class. Uploads a batch of logs to a specific log stream in a log group in the Infrequent Access log class. Uploads a batch of vended logs to a specific S3 bucket Perform Parquet conversion on logs delivered to Amazon S3 Uploads a batch of vended logs to Amazon Data Firehose Optimizing and reducing costs of CloudWatch Logs 32 Amazon CloudWatch User Guide To analyze costs, use AWS Cost Explorer Service or AWS Cost and Usage Reports with Athena. With either method, you can identify which logs are generating costs and determine how the costs are generated. Using AWS Cost Explorer Service Select CloudWatch for the Service filter and select Resource for the Dimension. When you select Resource as the dimension in Cost Explorer Service you can see only the past 14 days of usage. Using Amazon Athena query to track logs that generate costs You can use the following query to track which logs generate costs by resource ID. SELECT line_item_resource_id AS ResourceID, line_item_usage_type AS Operation, SUM(CAST(line_item_unblended_cost AS decimal(16,8))) AS TotalSpend FROM costandusagereport WHERE product_product_name = 'AmazonCloudWatch' AND year='2025' AND month='1' Optimizing and reducing costs of CloudWatch Logs 33 Amazon CloudWatch AND line_item_operation IN User Guide ('PutLogEvents','HourlyStorageMetering','StartQuery','LogDelivery','StartLiveTail','ParquetConversion') AND line_item_line_item_type NOT IN ('Tax','Credit','Refund','EdpDiscount','Fee','RIFee') GROUP BY line_item_resource_id, line_item_usage_type ORDER BY TotalSpend DESC To make the most of costs that are generated by CloudWatch Logs, consider the following: • Identify top log groups by spend per operation by using the previous query. • Log only the events that bring your business value and choose an efficient log syntax. A verbose log syntax drives volume and thus cost. This helps you generate lower costs for ingestion. • Change your log retention settings, so that you generate lower costs for storage. For more information, see Change log data retention in CloudWatch Logs in the Amazon CloudWatch Logs User Guide. |
acw-ug-018 | acw-ug.pdf | 18 | line_item_resource_id, line_item_usage_type ORDER BY TotalSpend DESC To make the most of costs that are generated by CloudWatch Logs, consider the following: • Identify top log groups by spend per operation by using the previous query. • Log only the events that bring your business value and choose an efficient log syntax. A verbose log syntax drives volume and thus cost. This helps you generate lower costs for ingestion. • Change your log retention settings, so that you generate lower costs for storage. For more information, see Change log data retention in CloudWatch Logs in the Amazon CloudWatch Logs User Guide. • Consider using the Infrequent Access log class where appropriate. Infrequent Access logs offers fewer features than Standard class. Determine whether you need the additional features of Standard log class and understand the difference between both classes. For more information, see the blog article New CloudWatch Logs log class for infrequent access logs at a reduced price. While the Infrequent Access class supports fewer features, it is suitable for a majority of use cases. • Run queries that CloudWatch Logs Insights automatically saves in your history. This way, you generate fewer costs for analysis. For more information, see View running queries or query history in the Amazon CloudWatch Logs User Guide. • Use the CloudWatch agent to collect system and application logs and send them to CloudWatch. This way, you can collect only the log events that meet your criteria. For more information, see Amazon CloudWatch Agent adds Support for Log Filter Expressions. To reduce costs for vended logs, consider your use case, and then determine whether your logs should be sent to CloudWatch or Amazon S3. For more information, see Logs sent to Amazon S3 in the Amazon CloudWatch Logs User Guide. Optimizing and reducing costs of CloudWatch Logs 34 Amazon CloudWatch Tip User Guide If you want to use metric filters, subscription filters, CloudWatch Logs Insights, and Contributor Insights, send vended logs to CloudWatch. Alternatively, if you're working with VPC Flow Logs and using them for auditing and compliance purposes, send vended logs to Amazon S3. For information about how to track charges that are generated by publishing VPC Flow Logs to S3 buckets, see Using AWS Cost and Usage Reports and cost allocation tags to understand VPC FLow Logs data ingestion in Amazon S3. For additional information about how to make the most of costs that are generated by CloudWatch Logs, see Which log group is causing a sudden increase in my CloudWatch Logs bill?. Optimizing and reducing costs of CloudWatch Logs 35 Amazon CloudWatch User Guide Using Amazon CloudWatch dashboards Amazon CloudWatch includes automatic pre-built dashboards and also enables you to create your own dashboards. Dashboards help you to monitor your resources in a single view, even those resources that are spread across different Regions. You can use CloudWatch dashboards to create customized views of the telemetry data for your AWS resources. With customizable dashboards, you can create the following: • A single view for selected metrics and alarms to help you assess the health of your resources and applications across one or more Regions. You can select the color used for each metric on each graph, so that you can easily track the same metric across multiple graphs. • An operational playbook that provides guidance for team members during operational events about how to respond to specific incidents. • A common view of critical resource and application measurements that can be shared by team members for faster communication flow during operational events. If you have multiple AWS accounts, you can set up CloudWatch cross-account observability and then create rich cross-account dashboards in your monitoring accounts. You can seamlessly search, visualize, and analyze your metrics, logs, and traces without account boundaries. With CloudWatch cross-account observability, you can do the following in a dashboard in a monitoring account: • Search, view, and create graphs of metrics that reside in source accounts. A single graph can include metrics from multiple accounts. • Create alarms in the monitoring account that watch metrics in source accounts. • View the log events from log groups located in source accounts, and run CloudWatch Logs Insights queries of log groups in source accounts. A single CloudWatch Logs Insights query in a monitoring account can query multiple log groups in multiple source accounts at once. • View nodes from source accounts in a trace map in X-Ray. You can then filter the map to specific source accounts. When you are signed in to a monitoring account, a blue Monitoring account badge appears at the top right of every page that supports CloudWatch cross-account observability functionality. 36 Amazon CloudWatch User Guide For more information about setting up CloudWatch cross-account observability, see CloudWatch cross-account observability. You can create dashboards from the console or using the AWS |
acw-ug-019 | acw-ug.pdf | 19 | A single CloudWatch Logs Insights query in a monitoring account can query multiple log groups in multiple source accounts at once. • View nodes from source accounts in a trace map in X-Ray. You can then filter the map to specific source accounts. When you are signed in to a monitoring account, a blue Monitoring account badge appears at the top right of every page that supports CloudWatch cross-account observability functionality. 36 Amazon CloudWatch User Guide For more information about setting up CloudWatch cross-account observability, see CloudWatch cross-account observability. You can create dashboards from the console or using the AWS CLI or PutDashboard API operation. You can add dashboards to a favorites list, where you can access not only your favorite dashboards, but also your recently visited dashboards. For more information, see Add a dashboard to your favorites list. To access CloudWatch dashboards, you need one of the following: • The AdministratorAccess policy • The CloudWatchFullAccess policy • A custom policy that includes one or more of these specific permissions: • cloudwatch:GetDashboard and cloudwatch:ListDashboards to be able to view dashboards • cloudwatch:PutDashboard to be able to create or modify dashboards • cloudwatch:DeleteDashboards to be able to delete dashboards Topics • Getting started with CloudWatch automatic dashboards • Creating a customized CloudWatch dashboard • Creating a CloudWatch cross-account cross-Region dashboard with the AWS Management Console • Create a cross-account cross-Region dashboard programmatically • Creating a graph with metrics from different accounts and Regions in a CloudWatch dashboard • Adding an alarm from a different account to a CloudWatch cross-account dashboard • Creating flexible CloudWatch dashboards with dashboard variables • Using widgets on CloudWatch dashboards • Sharing CloudWatch dashboards • Using live data in CloudWatch dashboards • Viewing an animated CloudWatch dashboard • Adding a CloudWatch dashboard to your favorites list • Changing the period override setting or refresh interval for the CloudWatch dashboard • Changing the time range or time zone format of a CloudWatch dashboard 37 Amazon CloudWatch User Guide Getting started with CloudWatch automatic dashboards The CloudWatch home page automatically displays metrics about every AWS service you use. You can additionally create custom dashboards to display metrics about your custom applications, and display custom collections of metrics that you choose. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. The CloudWatch overview home page appears. The overview displays the following items, refreshed automatically. • Alarms by AWS service displays a list of AWS services you use in your account, along with the state of alarms in those services. Next to that, two or four alarms in your account are displayed. The number depends on how many AWS services you use. The alarms shown are those in the ALARM state or those that most recently changed state. These upper areas help you quickly assess the health of your AWS services, by seeing the alarm states in every service and the alarms that most recently changed state. This helps you monitor and quickly diagnose issues. • Below these areas is the default dashboard, if one exists. The default dashboard is a custom dashboard that you have created and named CloudWatch-Default. This is a convenient way for you to add metrics about your own custom services or applications to the overview page, or to bring forward additional key metrics from AWS services that you most want to monitor. Getting started with automatic dashboards 38 Amazon CloudWatch Note User Guide The automatic dashboards on the CloudWatch home page display only information from the current account, even if the account is a monitoring account set up for CloudWatch cross-account observability. For information about creating custom cross-account dashboards, see Creating a CloudWatch cross-account cross-Region dashboard with the AWS Management Console. From this overview, you can see a cross-service dashboard of metrics from multiple AWS service, or focus your view to a specific resource group or a specific AWS service. This enables you to narrow your view to a subset of resources in which you are interested. Topics • Viewing the cross-service CloudWatch dashboard • Removing a service from appearing in the CloudWatch cross-service dashboard • Viewing a CloudWatch dashboard for a single AWS service • Viewing a CloudWatch dashboard for a resource group Viewing the cross-service CloudWatch dashboard You can switch to the Cross-service dashboard screen and interact with dashboards for all of the AWS services that you're using. The CloudWatch Console displays your dashboards in alphabetical order and displays one or two key metrics from each service. Note If you're using five or more AWS services, the CloudWatch Console won't display the Cross- service dashboard on the Overview screen. To view the Cross-service dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. You're directed to the Overview screen. Viewing the cross-service dashboard 39 Amazon CloudWatch User Guide 2. From the Overview screen, select the dropdown that reads Overview, |
acw-ug-020 | acw-ug.pdf | 20 | You can switch to the Cross-service dashboard screen and interact with dashboards for all of the AWS services that you're using. The CloudWatch Console displays your dashboards in alphabetical order and displays one or two key metrics from each service. Note If you're using five or more AWS services, the CloudWatch Console won't display the Cross- service dashboard on the Overview screen. To view the Cross-service dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. You're directed to the Overview screen. Viewing the cross-service dashboard 39 Amazon CloudWatch User Guide 2. From the Overview screen, select the dropdown that reads Overview, and then choose Cross service dashboard. You're directed to the Cross service dashboard screen. 3. (Optional) If you're using the original interface, scroll to the section Cross-service dashboard, and then choose View Cross-service dashboard. You're directed to the Cross-service dashboard screen. 4. You can focus on a particular service in two ways: a. To see more key metrics for a service, choose its name from the list at the top of the screen, where Cross service dashboard is currently shown. Or, you can choose View Service dashboard next to the service name. An automatic dashboard for that service is displayed, showing more metrics for that service. Additionally, for some services, the bottom of the service dashboard displays resources related to that service. You can choose one of those resources to that service console and focus further on that resource. b. To see all the alarms related to a service, choose the button on the right of the screen next to that service name. The text on this button indicates how many alarms you have created in this service, and whether any are in the ALARM state. When the alarms are displayed, multiple alarms that have similar settings (such as dimensions, threshold, or period) may be shown in a single graph. You can then view details about an alarm and see the alarm history. To do so, hover on the alarm graph, and choose the actions icon, View in alarms. The alarms view appears in a new browser tab, displaying a list of your alarms, along with details about the chosen alarm. To see the history for this alarm, choose the History tab. 5. You can focus on resources in a particular resource group. To do so, choose the resource group from the list at the top of the page where All resources is displayed. For more information, see Viewing a CloudWatch dashboard for a resource group. 6. To change the time range shown in all graphs and alarms currently displayed, select the range you want next to Time range at the top of the screen. Choose custom to select from more time range options than those displayed by default. Viewing the cross-service dashboard 40 Amazon CloudWatch User Guide 7. Alarms are always refreshed once a minute. To refresh the view, choose the refresh icon (two curved arrows) at the top right of the screen. To change the automatic refresh rate for items on the screen other than alarms, choose the down arrow next to the refresh icon and choose the refresh rate you want. You can also choose to turn off automatic refresh. Removing a service from appearing in the CloudWatch cross-service dashboard You can prevent a service's metrics from appearing in the cross-service dashboard. This helps you focus your cross-service dashboard on the services you most want to monitor. If you remove a service from the cross-service dashboard, the alarms for that service still appear in the views of your alarms. To remove a service's metrics from the cross-service dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. The home page appears. 2. At the top of the page, under Overview, choose the service you want to remove. The view changes to show metrics from only that service. 3. Choose Actions, then clear the check box next to Show on cross service dashboard. Viewing a CloudWatch dashboard for a single AWS service On the CloudWatch home page, you can focus the view to a single AWS service. You can drill down further by focusing on both a single AWS service and a resource group at the same time. The following procedure shows only how to focus on an AWS service. To focus on a single service 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. The home page appears. 2. For Overview, where Overview is currently shown in the drop down menu, choose Service dashboards. 3. Choose the service that you want to focus on. Removing a service from appearing in the cross-service dashboard 41 Amazon CloudWatch User Guide The view changes to display graphs of key metrics from the selected service. 4. To switch to viewing the alarms for this service, select the check box for In alarm, Insufficient data, or |
acw-ug-021 | acw-ug.pdf | 21 | procedure shows only how to focus on an AWS service. To focus on a single service 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. The home page appears. 2. For Overview, where Overview is currently shown in the drop down menu, choose Service dashboards. 3. Choose the service that you want to focus on. Removing a service from appearing in the cross-service dashboard 41 Amazon CloudWatch User Guide The view changes to display graphs of key metrics from the selected service. 4. To switch to viewing the alarms for this service, select the check box for In alarm, Insufficient data, or OK near the top of the screen where the service name is currently displayed. 5. When viewing metrics, you can focus on a particular metric in several ways: a. To see more details about the metrics in any graph, hover on the graph, and choose the actions icon, View in metrics. The graph appears in a new tab, with the relevant metrics listed below the graph. You can customize your view of this graph, changing the metrics and resources shown, the statistic, the period, and other factors to get a better understanding of the current situation. b. You can view log events from the time range shown in the graph. This may help you discover events that happened in your infrastructure that are causing an unexpected change in your metrics. To see the log events, hover on the graph, and choose the actions icon, View in logs. The CloudWatch Logs view appears in a new tab, displaying a list of your log groups. To see the log events in one of these log groups that occurred during the time range shown in the original graph, choose that log group. 6. When viewing alarms, you can focus on a particular alarm in several ways: • To see more details about an alarm, hover on the alarm, and choose the actions icon, View in alarms. The alarms view appears in a new tab, displaying a list of your alarms, along with details about the chosen alarm. To see the history for this alarm, choose the History tab. 7. Alarms are always refreshed one time per minute. To refresh the view, choose the refresh icon (two curved arrows) at the top right of the screen. To change the automatic refresh rate for items on the screen other than alarms, choose the down arrow next to the refresh icon and choose a refresh rate. You can also choose to turn off automatic refresh. 8. 9. To change the time range shown in all graphs and alarms currently displayed, next to Time range at the top of the screen, choose the range. To select from more time range options than those displayed by default, choose custom. To return to the cross-service dashboard, choose Overview in the list at the top of the screen that currently shows the service you are focusing on. Viewing a dashboard for a single service 42 Amazon CloudWatch User Guide Alternatively, from any view, you can choose CloudWatch at the top of the screen to clear all filters and return to the overview page. Viewing a CloudWatch dashboard for a resource group You can focus your view to display metrics and alarms from a single resource group. Using resource groups enables you to use tags to organize projects, focus on a subset of your architecture, or distinguish between your production and development environments. They also enable you to focus on each of these resource groups on the CloudWatch overview. For more information, see What Is AWS Resource Groups?. When you focus on a resource group, the display changes to show only the services where you have tagged resources as part of this resource group. The recent alarms area shows only the alarms that are associated with resources that are part of the resource group. Additionally, if you have created a dashboard with the name CloudWatch-Default-ResourceGroupName, it is displayed in the Default dashboard area. You can drill down further by focusing on both a single AWS service and a resource group at the same time. The following procedure shows just how to focus on a resource group. To focus on a single resource group 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. At the top of the page, where All resources is displayed, choose a resource group. 3. To see more metrics related to this resource group, near the bottom of the screen, choose View cross service dashboard. The cross-service dashboard appears, showing only the services related to this resource group. For each service, one or two key metrics are displayed. 4. To change the time range shown in all graphs and alarms currently displayed, for Time range at the top of the screen, select a range. To select from more time |
acw-ug-022 | acw-ug.pdf | 22 | resource group 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. At the top of the page, where All resources is displayed, choose a resource group. 3. To see more metrics related to this resource group, near the bottom of the screen, choose View cross service dashboard. The cross-service dashboard appears, showing only the services related to this resource group. For each service, one or two key metrics are displayed. 4. To change the time range shown in all graphs and alarms currently displayed, for Time range at the top of the screen, select a range. To select from more time range options than those displayed by default, choose custom. 5. Alarms are always refreshed one time per minute. To refresh the view, choose the refresh icon (two curved arrows) at the top right of the screen. To change the automatic refresh rate for items on the screen other than alarms, choose the down arrow next to the refresh icon and choose a refresh rate. You can also choose to turn off automatic refresh. Viewing a dashboard for a resource group 43 Amazon CloudWatch User Guide 6. To return to showing information about all the resources in your account, near the top of the screen where the name of the resource group is currently displayed, choose All resources. Creating a customized CloudWatch dashboard To get started, create a CloudWatch dashboard. You can create multiple dashboards, and you can add dashboards to a favorites list. You aren't limited to the number of dashboards that you can have in your AWS account. All dashboards are global. They are not Region-specific. The following procedure shows you how to create a dashboard from the CloudWatch console. You can use the PutDashboard API operation to create a dashboard from the command line interface. The API operation contains a JSON string that defines your dashboard content. For more information about creating a dashboard with the PutDashboard API operation, see PutDashboard in the Amazon CloudWatch API Reference. Tip If you're creating a new dashboard with the PutDashboard API operation, you can use the JSON string from a dashboard that already exists. To create a dashboard from the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose Create dashboard. In the Create new dashboard dialog box, enter a name for the dashboard, and then choose Create dashboard. If you use the name CloudWatch-Default or CloudWatch-Default-ResourceGroupName, the dashboard appears in the overview of the CloudWatch home page under Default Dashboard. For more information, see Getting started with CloudWatch automatic dashboards. 4. In the Add to this dashboard dialog box, do one of the following: • To add a graph to the dashboard, choose Line or Stacked area, and then choose Configure. In the Add metric graph dialog box, select the metric(s) to graph, and then choose Create widget. If a metric doesn't appear in the dialog box because it hasn't published data in more than 14 days, you can add it manually. For more information, see Graph metrics manually on a CloudWatch dashboard. Creating a customized dashboard 44 Amazon CloudWatch User Guide • • To add a number displaying a metric to the dashboard, choose Number, and then choose Configure. In the Add metric graph dialog box, select the metric(s) to graph, and then choose Create widget. To add a text block to the dashboard, choose Text, and then choose Configure. In the New text widget dialog box, for Markdown, format your text using Markdown, and then choose Create widget. 5. (Optional) Choose Add widget, and then repeat step 4 to add another widget to the dashboard. You can repeat this step multiple times. For each graph on the dashboard, there is an information icon at the upper right. Choose this icon to see the descriptions of the metrics in the graph. 6. Choose Save dashboard. Creating a CloudWatch cross-account cross-Region dashboard with the AWS Management Console You can create cross-account cross-Region dashboards, which summarize your CloudWatch data from multiple AWS accounts and multiple Regions into one dashboard. From this high-level dashboard you can get a view of your entire application, and also drill down into more specific dashboards without having to sign in and out of accounts or switch Regions. Prerequisite Before you can create a cross-account cross-Region dashboard, you must enable at least one sharing account and at least one monitoring account. Additionally, to be able to use the CloudWatch console to create a cross-account dashboard, you must enable the console for cross- account functionality. For more information, see Cross-account cross-Region CloudWatch console. To create a cross-account cross-Region dashboard 1. Sign in to the monitoring account. 2. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 3. In the navigation pane, choose Dashboards. 4. Choose a dashboard, or create a new |
acw-ug-023 | acw-ug.pdf | 23 | having to sign in and out of accounts or switch Regions. Prerequisite Before you can create a cross-account cross-Region dashboard, you must enable at least one sharing account and at least one monitoring account. Additionally, to be able to use the CloudWatch console to create a cross-account dashboard, you must enable the console for cross- account functionality. For more information, see Cross-account cross-Region CloudWatch console. To create a cross-account cross-Region dashboard 1. Sign in to the monitoring account. 2. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 3. In the navigation pane, choose Dashboards. 4. Choose a dashboard, or create a new one. Creating a cross-account cross-Region dashboard with the console 45 Amazon CloudWatch User Guide 5. At the top of the screen, you can switch between accounts and Regions. As you create your dashboard, you can include widgets from multiple accounts and Regions. Widgets include graphs, alarms, and CloudWatch Logs Insights widgets. Create a cross-account cross-Region dashboard programmatically You can use the AWS APIs and SDKs to create dashboards programmatically. For more information, see PutDashboard. To enable cross-account cross-Region dashboards, we have added new parameters to the dashboard body structure, as shown in the following table and examples. For more information about overall dashboard body structure, see Dashboard Body Structure and Syntax. Parameter Use Scope Default accountId Specifies the ID of the account where the widget or the metric is Widget or metric Account that is currently logged in located. region Specifies the Region of the metric. Widget or metric Current Region selected in the console The following examples illustrate the JSON source for widgets in a cross-account cross-Region dashboard. This example sets the accountId field to the ID of the sharing account at the widget level. This specifies that all metrics in this widget will come from that sharing account and Region. { "widgets": [ { ... "properties": { "metrics": [ … Create a cross-account cross-Region dashboard programmatically 46 Amazon CloudWatch ], "accountId": "111122223333", "region": "us-east-1" } } ] } User Guide This example sets the accountId field differently at the level of each metric. In this example, the different metrics in this metric math expression come from different sharing accounts and different Regions. { "widgets": [ { ... "properties": { "metrics": [ [ { "expression": "SUM(METRICS())", "label": "[avg: ${AVG}] Expression1", "id": "e1", "stat": "Sum" } ], [ "AWS/EC2", "CPUUtilization", { "id": "m2", "accountId": "5555666677778888", "region": "us-east-1", "label": "[avg: ${AVG}] ApplicationALabel " } ], [ ".", ".", { Create a cross-account cross-Region dashboard programmatically 47 Amazon CloudWatch User Guide "id": "m1", "accountId": "9999000011112222", "region": "eu-west-1", "label": "[avg: ${AVG}] ApplicationBLabel" } ] ], "view": "timeSeries", "region": "us-east-1", ---> home region of the metric. Not present in above example "stacked": false, "stat": "Sum", "period": 300, "title": "Cross account example" } } ] } This example shows an alarm widget. { "type": "metric", "x": 6, "y": 0, "width": 6, "height": 6, "properties": { "accountID": "111122223333", "title": "over50", "annotations": { "alarms": [ "arn:aws:cloudwatch:us-east-1:379642911888:alarm:over50" ] }, "view": "timeSeries", "stacked": false } } Create a cross-account cross-Region dashboard programmatically 48 Amazon CloudWatch User Guide This example is for a CloudWatch Logs Insights widget. { "type": "log", "x": 0, "y": 6, "width": 24, "height": 6, "properties": { "query": "SOURCE 'route53test' | fields @timestamp, @message\n| sort @timestamp desc\n| limit 20", "accountId": "111122223333", "region": "us-east-1", "stacked": false, "view": "table" } } Another way to create dashboards programmatically is to first create one in the AWS Management Console, and then copy the JSON source of this dashboard. To do so, load the dashboard and choose Actions, View/edit source. You can then copy this dashboard JSON to use as a template to create similar dashboards. Creating a graph with metrics from different accounts and Regions in a CloudWatch dashboard 1. Sign in to the monitoring account. 2. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 3. 4. In the navigation pane, choose Metrics, and then choose All metrics. Select the account and Region that you want to add metrics from. You can select your account and Region from the account and Region dropdown menus near the top-right of the screen. 5. Add the metrics you want to the graph. For more information, see Graphing metrics. 6. Repeat steps 4-5 to add metrics from other accounts and Regions. Creating a graph with metrics from different accounts and Regions 49 Amazon CloudWatch User Guide 7. (Optional) Choose the Graphed metrics tab and add a metric math function that uses the metrics that you have chosen. For more information, see Using math expressions with CloudWatch metrics. You can also set up a single graph to include multiple SEARCH functions. Each search can refer to a different account or Region. 8. When you are finished with the graph, choose Actions, Add to dashboard. Select your cross-account dashboard, and choose Add to dashboard. Adding an alarm from a |
acw-ug-024 | acw-ug.pdf | 24 | other accounts and Regions. Creating a graph with metrics from different accounts and Regions 49 Amazon CloudWatch User Guide 7. (Optional) Choose the Graphed metrics tab and add a metric math function that uses the metrics that you have chosen. For more information, see Using math expressions with CloudWatch metrics. You can also set up a single graph to include multiple SEARCH functions. Each search can refer to a different account or Region. 8. When you are finished with the graph, choose Actions, Add to dashboard. Select your cross-account dashboard, and choose Add to dashboard. Adding an alarm from a different account to a CloudWatch cross-account dashboard 1. Sign in to the monitoring account. 2. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 3. At the top of the page, choose the account where the alarm is located. 4. 5. 6. In the navigation pane, choose Alarms. Select the check box next to the alarm that you want to add, and choose Add to dashboard. Select the cross-account dashboard that you want to add it to, and choose Add to dashboard. Creating flexible CloudWatch dashboards with dashboard variables Use dashboard variables to create flexible dashboards that can quickly display different content in multiple widgets, depending on the value of an input field within the dashboard. For example, you can create a dashboard that can quickly switch between different Lambda functions or Amazon EC2 instance IDs, or one that can switch to different AWS Regions. After you create a dashboard that uses a variable, you can copy the same variable pattern to other existing dashboards. Using dashboard variables improves the operational workflow for people who use your dashboards. It can also reduce your costs because you're using dashboard variables in one dashboard instead of creating multiple similar dashboards. Adding an alarm from a different account to a cross-account dashboard 50 Amazon CloudWatch Note User Guide If you share a dashboard that contains dashboard variables, the people that you share it with won't be able to change between the variable values. Types of dashboard variables The dashboard variable can be a property variable or a pattern variable. • Property variables change all instances of a property in all widgets in the dashboard. This property can be any JSON property in the JSON source of a dashboard, such as region. Or it can be a dimension name for a metric, such as InstanceID or FunctionName. For a tutorial that uses a property variable, see Tutorial: Creating a CloudWatch Lambda dashboard with function name as the variable. For more information about the JSON source of dashboards, see Dashboard Body Structure and Syntax. In the CloudWatch console, you can see the JSON source for any custom dashboard by choosing Actions, View/edit source. • Pattern variables use a regular expression pattern to change all of a JSON property or only a certain part of it. For a tutorial that uses a pattern variable, see Tutorial: Creating a dashboard that uses a regular expression pattern to switch between AWS Regions. Property variables apply to most use cases and are less complex to set up. Topics • Copying a variable to another CloudWatch dashboard • Tutorial: Creating a dashboard that uses a regular expression pattern to switch between AWS Regions • Tutorial: Creating a CloudWatch Lambda dashboard with function name as the variable Types of dashboard variables 51 Amazon CloudWatch User Guide Copying a variable to another CloudWatch dashboard After you create a dashboard with useful variables, you can copy these variables to other existing dashboards. For more information about dashboard variables, see Creating flexible CloudWatch dashboards with dashboard variables. To copy a dashboard variable to another dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose the name of the dashboard that has the variable that you want to copy. Enter a string to find dashboards with matching names, if needed. 3. Choose Actions, Variables, Manage variables. 4. Choose the radio button next to the variable that you want to copy, and choose Copy to another dashboard. 5. Choose the selection box and start typing the dashboard name that you want to copy the variable to. 6. Select the dashboard name and choose Copy variable. Tutorial: Creating a dashboard that uses a regular expression pattern to switch between AWS Regions The steps in this procedure illustrate how to create a flexible dashboard that can switch between Regions. This tutorial uses a regular expression pattern variable instead of a property variable. For a tutorial that uses a property variable, see Tutorial: Creating a CloudWatch Lambda dashboard with function name as the variable. For many use cases, you can create a dashboard that switches between Regions by using a property variable. But if the widgets rely on Amazon Resource Names (ARNs) that include |
acw-ug-025 | acw-ug.pdf | 25 | and choose Copy variable. Tutorial: Creating a dashboard that uses a regular expression pattern to switch between AWS Regions The steps in this procedure illustrate how to create a flexible dashboard that can switch between Regions. This tutorial uses a regular expression pattern variable instead of a property variable. For a tutorial that uses a property variable, see Tutorial: Creating a CloudWatch Lambda dashboard with function name as the variable. For many use cases, you can create a dashboard that switches between Regions by using a property variable. But if the widgets rely on Amazon Resource Names (ARNs) that include Region names, you must use a pattern variable to change the Region names within the ARNs. To use a dashboard pattern variable to create a flexible multi-Region dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, Create dashboard. Enter a name for the dashboard, and choose Create dashboard. Copying a variable to another dashboard 52 Amazon CloudWatch User Guide 4. Add widgets to the dashboard. When you add the widgets that you want to display Region- specific data, avoid specifying any dimensions with values that appear in only one Region. For example, for Amazon EC2 metrics, specify metrics that are aggregated instead of metrics that use InstanceID as a dimension. For more information about adding widgets to a dashboard, see Using widgets on CloudWatch dashboards. 5. After you add the widgets, as you are viewing the dashboard, choose Actions, Variables, Create a variable. 6. Choose Pattern variable. 7. For Property that the variable changes, enter the name of the current dashboard Region, such as us-east-2. You have the correct Region entered if the label below that box displays the widgets that will be impacted by the variable. For Input type, for this use case, select Radio button. For Define how inputs are populated, choose Create a list of custom values. 8. 9. 10. For Create your custom values, enter the Regions that you want to switch between, with one Region on each line. After each Region, enter a comma and then the label to display for that radio button. For example: us-east-1, N. Virginia us-east-2, Ohio eu-west-3, Paris As you fill in the custom values, the Preview pane updates to display what the radio buttons will look like. 11. (Optional) For more settings, choose Secondary settings and do one or more of the following: • To customize the name of your variable, enter the name in Custom variable name. • To customize the label for the variable input field, enter the label in Input label. For this tutorial, enter Region:. If you enter a value here, the Preview pane updates to display what the radio buttons will look like. Tutorial: Using a regular expression pattern to switch between Regions 53 Amazon CloudWatch User Guide • To set the default value for this variable when the dashboard is first opened, enter the default in Default value. 12. Choose Add variable. The dashboard appears, with a Region: label next to the radio buttons for the Regions near the top. When you switch between Regions, all the widgets that use the variable will display information about the selected Region. Tutorial: Creating a CloudWatch Lambda dashboard with function name as the variable The steps in this procedure illustrate how to create a flexible dashboard that shows a variety of metric graphs, using a property variable. This includes a dropdown selection box on the dashboard that you can use to switch the metrics in all the graphs between different Lambda functions. Other use case examples for this type of dashboard include using InstanceId as the variable to create a dashboard of metrics with a dropdown for instance IDs. Alternatively, you could create a dashboard that uses region as the variable to display the same set of metrics from different Regions. To use a dashboard property variable to create a flexible Lambda dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, Create dashboard. Enter a name for the dashboard, and choose Create dashboard. 4. Add widgets to the dashboard that display metrics for a Lambda function. When you create these widgets, specify Lambda, By Function Name for the widget metrics. For the function, specify one of the Lambda functions that you want to include in this dashboard. For more information about adding widgets to a dashboard, see Using widgets on CloudWatch dashboards. 5. After you add the widgets, as you are viewing the dashboard, choose Actions, Variables, Create a variable. 6. Choose Property variable. 7. For Property that the variable changes, choose FunctionName. Tutorial: Creating dashboard with the Lambda function name as a variable 54 Amazon CloudWatch User Guide 8. For Input type, for this use case, we recommend choosing Select menu |
acw-ug-026 | acw-ug.pdf | 26 | Lambda, By Function Name for the widget metrics. For the function, specify one of the Lambda functions that you want to include in this dashboard. For more information about adding widgets to a dashboard, see Using widgets on CloudWatch dashboards. 5. After you add the widgets, as you are viewing the dashboard, choose Actions, Variables, Create a variable. 6. Choose Property variable. 7. For Property that the variable changes, choose FunctionName. Tutorial: Creating dashboard with the Lambda function name as a variable 54 Amazon CloudWatch User Guide 8. For Input type, for this use case, we recommend choosing Select menu (dropdown). This creates a dropdown menu in the dashboard where you can select the Lambda function name to display metrics for. If this was for a dashboard that toggled between only two or three different values for a variable, then Radio button would be a good choice. If you prefer to enter or paste in values for the variable, you would choose Text input. This option doesn't include a dropdown list or radio buttons. 9. When you choose Select menu (dropdown), you must then choose whether to populate the menu by entering values, or using a metric search. For this use case, let's assume that you have a large number of Lambda functions and you don't want to enter all of them manually. Choose Use the results of a metric search and then do the following: a. Choose Pre-built queries, Lambda, Errors. (Choosing Errors does not add the Errors metric to the dashboard. However, it quickly populates the FunctionName variable selection box.) b. Choose By Function Name and then choose Search. Under the Search button, you will then see FunctionName selected. You also see a message about how many FunctionName dimension values were found to populate the input box. 10. (Optional) For more settings, choose Secondary settings and do one or more of the following: • To customize the name of your variable, enter the name in Custom variable name. • To customize the label for the variable input field, enter the label in Input label. • To set the default value for this variable when the dashboard is first opened, enter the default in Default value. 11. Choose Add variable. A FunctionName dropdown selection box appears near the top of the dashboard. You can select a Lambda function in this box and all the widgets that use the variable will display information about the selected function. Later, if you add more widgets to the dashboard that watch Lambda metrics with the FunctionName dimension, they will automatically use the variable. Tutorial: Creating dashboard with the Lambda function name as a variable 55 Amazon CloudWatch User Guide Using widgets on CloudWatch dashboards You can use the following types of widgets on CloudWatch dashboards: • Graph widget – You can add graphs that contain one or more metrics to your CloudWatch dashboard. The types of graphs that you can add to your dashboard include Line, Stacked area, Number, Gauge, Bar, and Pie. You can remove graphs from your dashboard when you don't need them anymore. • Manual metrics widget – If a metric hasn't published data in the past 14 days, you can't find it when searching for metrics to add to a graph on a CloudWatch dashboard. You can add any metric manually to an existing graph. • Metrics explorer widget – Metrics explorer widgets include graphs of multiple resources that have the same tag, or share the same resource property such as an instance type. These widgets stay up to date, as resources that match are created or deleted. Adding metrics explorer widgets to your dashboard helps you to troubleshoot your environment more efficiently. For example, you can monitor your fleet of EC2 instances by assigning tags that represent their environments, such as production or test. You can then use these tags to filter and aggregate the operational metrics, such as CPUUtilization, to understand the health and performance of the EC2 instances that are associated with each tag. • Line widget – With the line widget, you can compare metrics over periods of time. You also can use the widget's mini-map zoom feature to inspect sections of line graphs without changing between zoomed-in and zoomed-out views. The procedures in this section describe how to add and remove a line widget on a CloudWatch dashboard. For information about using the widget's mini-map zoom feature with line graphs, see Zooming in on a line or stacked area graph. • Number widget – With the number widget, you can look at the latest metric values and trends as soon as they appear. Because the number widget includes the sparkline feature, you can visualize the top and bottom halves of metric trends in a single graph. The procedures in this section describe how to |
acw-ug-027 | acw-ug.pdf | 27 | changing between zoomed-in and zoomed-out views. The procedures in this section describe how to add and remove a line widget on a CloudWatch dashboard. For information about using the widget's mini-map zoom feature with line graphs, see Zooming in on a line or stacked area graph. • Number widget – With the number widget, you can look at the latest metric values and trends as soon as they appear. Because the number widget includes the sparkline feature, you can visualize the top and bottom halves of metric trends in a single graph. The procedures in this section describe how to add and remove a number widget from a CloudWatch dashboard. • Gauge widget – With the gauge widget, you can visualize metric values that go between ranges. For example, you can use the gauge widget to graph percentages and CPU utilization, so that you can observe and diagnose any performance issues that occur. The procedures in this section describe how to add and remove a gauge widget from a CloudWatch dashboard. • Text widget – A text widget contains a block of text in Markdown format. You can add, edit, or remove text widgets from your CloudWatch dashboard. • Alarm widget – To add an alarm widget to a dashboard, choose one of the following options: Using widgets on dashboards 56 Amazon CloudWatch User Guide • Add a single alarm in a widget, which displays the graph of the alarm's metric and also displays the alarm status. • Add an alarm status widget, which displays the status of multiple alarms in a grid. Only the alarm names and current status are displayed, Graphs are not displayed. You can include up to 100 alarms in one alarm status widget. • Table widget – With the data table widget, you can see the raw datapoints of your metric and a quick summary of that raw data. Because the data table widget is not a chart to abstract the actual data away from you, it is easier to understand the datapoints being presented. The procedures in this section describe how to add and remove a data table widget from a CloudWatch dashboard. The following image shows an example of a table widget with columns for the Minimum, Maximum, Sum, and Average statistics for a set of CloudWatch metrics. • Linked graphs – You can link the graphs on your dashboard together, so that when you zoom in or zoom out on one graph, the other graphs zoom in or zoom out at the same time. You can unlink graphs to limit zoom to one graph. Topics • Adding a graph widget to a CloudWatch dashboard • Removing a graph widget from a CloudWatch dashboard • Graph metrics manually on a CloudWatch dashboard • Editing a graph on a CloudWatch dashboard • Renaming a graph on a CloudWatch dashboard • Moving a graph on a CloudWatch dashboard • Changing the size of graphs on CloudWatch dashboards • Changing the size of a graph temporarily on a CloudWatch dashboard • Add a metrics explorer widget to a CloudWatch dashboard • Adding a line graph widget to a CloudWatch dashboard • Removing a line graph widget from a CloudWatch dashboard • Adding a number widget to a CloudWatch dashboard • Removing a number widget from a CloudWatch dashboard • Adding a gauge widget to a CloudWatch dashboard • Removing a gauge widget from a CloudWatch dashboard Using widgets on dashboards 57 Amazon CloudWatch User Guide • Using a custom widget on a CloudWatch dashboard • Adding a text widget to a CloudWatch dashboard • Editing a text widget on a CloudWatch dashboard • Removing a text widget from a CloudWatch dashboard • Adding an alarm to a CloudWatch dashboard • Adding an alarm status widget to a CloudWatch dashboard • Removing an alarm widget from a CloudWatch dashboard • Using a data table widget in a CloudWatch dashboard • Linking graphs on a CloudWatch dashboard • Unlinking graphs on a CloudWatch dashboard Adding a graph widget to a CloudWatch dashboard The procedures in this section describe how to add and remove graphs from your dashboard. For information about how to edit a graph on your dashboard, see Edit a graph on a CloudWatch dashboard. To add a graph to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol, and then choose the type of graph that you want to add to your dashboard, then choose Next. • If you select Line, Stacked area, Bar, or Pie, choose Metrics. 4. 5. In the Browse tab, search or browse for the metrics to graph, and select the ones that you want. (Optional) To change your graph's time range, select one of |
acw-ug-028 | acw-ug.pdf | 28 | see Edit a graph on a CloudWatch dashboard. To add a graph to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol, and then choose the type of graph that you want to add to your dashboard, then choose Next. • If you select Line, Stacked area, Bar, or Pie, choose Metrics. 4. 5. In the Browse tab, search or browse for the metrics to graph, and select the ones that you want. (Optional) To change your graph's time range, select one of the predefined time ranges in the upper part of the screen. The time ranges span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). To set your own time range, choose Custom. • (Optional) To have this widget keep using this time range that you select, even if the time range for the rest of the dashboard is later changed, choose Persist time range. Adding a graph widget 58 Amazon CloudWatch User Guide 6. (Optional) To change your graph's widget type, use the dropdown that's next to the predefined time ranges. 7. (Optional) In Graphed metrics, you can add a dynamic label to your metric and change your metric's label, label color, statistic, and period. You also can determine the position of labels on the Y-axis from left to right. a. To add a dynamic label, choose Graphed metrics, and then choose Add dynamic labels. Dynamic labels display a statistic about your metric in the graph legend. Dynamic labels update automatically when your dashboard or graph refreshes. By default, the dynamic values that you add to labels appear at the beginning of your labels. For more information, see Use dynamic labels. b. c. d. To change the color of a metric, choose the color square that's next to the metric. To change the statistic, select the dropdown under Statistic, and then choose a new value. For more information, see Statistics. To change the period, select the dropdown under the Period column, and then choose a new value. 8. 9. If you are creating a gauge widget, you must choose the Options tab and specify the Min and Max values to use for the two ends of the gauge. (Optional) To customize the Y-axis, choose Options. You can add a custom label under Left Y-axis in the label field. If your graph displays values on the right side of the Y-axis, you can customize that label, too. You also can set minimum and maximum limits on your Y-axis values, so that your graph only displays the value ranges that you specify. 10. (Optional) To add or edit horizontal annotations to line or stacked area graphs, or to add thresholds to gauge widgets, choose Options: a. b. c. d. e. f. To add a horizontal annotation or threshold, choose Add horizontal annotation or Add threshold. For Label, enter a label for the annotation then choose the check mark icon. For Value, choose the pen and paper icon that's next to the current value, and enter your new value. After you enter your value, choose the check mark icon. For Fill, select the dropdown and specify how your annotation will use shading. You can choose None, Above, Between, or Below. To change the fill color, choose the color square that's next to the annotation. For Axis, specify whether your annotation appears on the left or right side of the Y-axis. To hide an annotation, clear the check box that's next to the annotation you want to hide. Adding a graph widget 59 Amazon CloudWatch User Guide g. To delete an annotation, choose X under Actions. Note You can repeat these steps to add multiple horizontal annotations or thresholds to the same graph or gauge. 11. (Optional) To add or edit vertical annotations, choose Options: a. b. c. d. e. f. To add a vertical annotation, choose Add vertical annotation. For Label, choose the pen and paper icon that's next to the current annotation, and enter your new annotation. If you want to show only the date and time, leave the label field blank. For Date, choose the current date and time, and enter the new date and time. For Fill, select the dropdown, and specify how your annotation will use shading. You can choose None, Above, Between, or Below. To change the fill color, select the color square that's next to the annotation. To hide an annotation, clear the check box next to the annotation that you want to hide. To delete an annotation, choose X under Actions. Note You can repeat these steps to add multiple vertical annotations to the same graph. 12. Choose Create widget. 13. Choose Save dashboard. Removing a graph widget from a CloudWatch dashboard |
acw-ug-029 | acw-ug.pdf | 29 | and time, and enter the new date and time. For Fill, select the dropdown, and specify how your annotation will use shading. You can choose None, Above, Between, or Below. To change the fill color, select the color square that's next to the annotation. To hide an annotation, clear the check box next to the annotation that you want to hide. To delete an annotation, choose X under Actions. Note You can repeat these steps to add multiple vertical annotations to the same graph. 12. Choose Create widget. 13. Choose Save dashboard. Removing a graph widget from a CloudWatch dashboard To remove a graph from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper-right corner of the graph that you want to remove, choose Widget actions, and then choose Delete. Removing a graph widget 60 Amazon CloudWatch 4. Choose Save dashboard. User Guide Graph metrics manually on a CloudWatch dashboard To add a metric that you can't find in search to a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. The dashboard must already contain a graph where you want to add the metric. If it doesn't, create the graph and add any metric to it. For more information, see Adding a graph widget to a CloudWatch dashboard . 4. Choose Actions, View/edit source. A JSON block appears. The block specifies the widgets on the dashboard and their contents. The following is an example of one part of this block, which defines one graph. { "type": "metric", "x": 0, "y": 0, "width": 6, "height": 3, "properties": { "view": "singleValue", "metrics": [ [ "AWS/EBS", "VolumeReadOps", "VolumeId", "vol-1234567890abcdef0" ] ], "region": "us-west-1" } }, In this example, the following section defines the metric shown on this graph. Graph metrics manually on a dashboard 61 Amazon CloudWatch User Guide [ "AWS/EBS", "VolumeReadOps", "VolumeId", "vol-1234567890abcdef0" ] 5. Add a comma after the end bracket if there isn't already one and then add a similar bracketed section after the comma. In this new section, specify the namespace, metric name, and any necessary dimensions of the metric that you're adding to the graph. The following is an example. [ "AWS/EBS", "VolumeReadOps", "VolumeId", "vol-1234567890abcdef0" ], [ "MyNamespace", "MyMetricName", "DimensionName", "DimensionValue" ] For more information about the formatting of metrics in JSON, see Properties of a Metric Widget Object in the Amazon CloudWatch API Reference. 6. Choose Update. Editing a graph on a CloudWatch dashboard You can edit the graphs that you add to your CloudWatch dashboard. You can change a graph's title, statistic, or period. You can add, update, and remove metrics from your graphs. If your graph contains more than one metric, you can reduce clutter by hiding metrics that you aren't using. The procedures in this section describe how to edit a graph on your dashboard. For information about creating a graph, see Add or remove a graph from a CloudWatch dashboard. New interface To edit a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. 5. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper-right corner of the graph that you want to edit, choose Widget actions, and then choose Edit. To change the graph's title, choose the pen and paper icon that's next to the current title. Enter the new title, and then choose Apply. (Optional) To change your graph's time range, select one of the predefined time ranges in the upper are of the graph. The time ranges span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Editing a graph 62 Amazon CloudWatch User Guide To set your own time range, choose Custom. • (Optional) To have this widget keep using this time range that you select, even if the time range for the rest of the dashboard is later changed, choose Persist time range. 6. To change your graph's widget type, use dropdown that's next to the predefined time ranges. 7. In Graphed metrics, you can add a dynamic label to your metric and change your metric's label, label color, statistic, and period. You also can determine the position of labels on the Y-axis from left to right. a. To add a dynamic label for a metric, choose Dynamic labels. Dynamic labels display a statistic about the metric in the graph legend. Dynamic labels update automatically when your dashboard or graph refreshes. By default, the dynamic values that you add to labels appear at the beginning of the labels. For more information, see Use dynamic labels. b. c. d. To change the color of a metric, choose the color square that's next to the metric. To change |
acw-ug-030 | acw-ug.pdf | 30 | label, label color, statistic, and period. You also can determine the position of labels on the Y-axis from left to right. a. To add a dynamic label for a metric, choose Dynamic labels. Dynamic labels display a statistic about the metric in the graph legend. Dynamic labels update automatically when your dashboard or graph refreshes. By default, the dynamic values that you add to labels appear at the beginning of the labels. For more information, see Use dynamic labels. b. c. d. To change the color of a metric, choose the color square that's next to the metric. To change the statistic, choose the statistic value under the Statistic column, and then choose a new value. For more information, see Statistics. To change the period, choose the period value under the Period column, and then choose a new value. 8. To add or edit horizontal annotations, choose Options: a. b. c. d. To add a horizontal annotation, choose Add horizontal annotation. For Label, choose the pen and paper icon next to the current annotation. Then enter your new annotation. After you enter your annotation, choose the check mark icon. For Value, choose the pen and paper icon next to the current metric value. Then enter your new metric value. After you enter your value, select the check mark icon. For Fill, choose the dropdown under the column, and then specify how your annotation will use shading. You can choose None, Above, Between, or Below. If you choose Between, another new label and value field appears. Tip You can change the fill color by choosing the colored square next to the annotation. Editing a graph 63 Amazon CloudWatch User Guide e. For Axis, specify whether your annotation appears on the left or right side of the Y- axis. f. To hide an annotation, deselect the check box next to the annotation that you want to hide on the graph. g. To delete an annotation, choose X under the Actions column. Note You can repeat these steps to add multiple horizontal annotations to the same graph. 9. To add or edit vertical annotations, choose Options: a. b. c. d. To add a vertical annotation, choose Add vertical annotation. For Label, choose the pen and paper icon next to the current annotation. Then enter your new annotation. After you enter your annotation, choose the check mark icon. Tip To show only the date and time, leave the label field blank. For Date, choose the current date and time. Then enter the new date and time. For Fill, choose the dropdown under the column, and then specify how your annotation will use shading. You can choose None, Above, Between, or Below. If you choose Between, a new label and value field appears. Tip You can change the fill color by choosing the color square next to the annotation. Note You can repeat these steps to add multiple vertical annotations to the same graph. Editing a graph 64 Amazon CloudWatch User Guide e. To hide an annotation, deselect the check box next to the annotation that you want to hide on the graph. f. To delete an annotation, choose X under the Actions column. 10. To customize the Y-axis, choose Options. Under Left Y-axis, you can enter a custom label for Label. If the graph displays values on the right Y-axis, you can customize that label, too. You also can set minimums and maximums on the Y-axis values, so that the graph displays only the value range that you specify. 11. When you finish making changes, choose Update widget. To hide or change the position of a graph legend 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper-right corner of the graph that you want to edit, choose Widget actions. Choose Legend and select Hidden, Bottom, or Right. To temporarily hide metrics for a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. Select the color square for the metric that you want to hide in the graph's footer. An X appears in the color square when you hover over it, and the square turns gray when you choose it. 4. To restore the hidden metric, clear the X in the gray square. Original interface To edit a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the upper-right corner of the graph that you want to edit. Choose Widget actions, and then choose Edit. Editing a graph 65 Amazon CloudWatch User Guide 4. To change the graph's title, choose the pencil icon that's next to the current title, |
acw-ug-031 | acw-ug.pdf | 31 | when you hover over it, and the square turns gray when you choose it. 4. To restore the hidden metric, clear the X in the gray square. Original interface To edit a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the upper-right corner of the graph that you want to edit. Choose Widget actions, and then choose Edit. Editing a graph 65 Amazon CloudWatch User Guide 4. To change the graph's title, choose the pencil icon that's next to the current title, and then enter the new title. 5. 6. To change the graph's time range, choose one of the predefined time ranges in the upper area of the graph. These span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). • To set your own time range, choose custom. To change your graph's widget type, select the Graph options tab. You can choose Line, Stacked area, Number, Bar, or Pie. Tip You can change your graph's widget type by choosing the dropdown that's next to the predefined time ranges. 7. In Graphed metrics, you can add a dynamic label to your metric and change your metric's label, label color, statistic, and period. You also can determine the position of labels on the Y-axis from left to right. a. To add a dynamic label for a metric, choose Dynamic labels. Dynamic labels display a statistic about the metric in the graph legend. Dynamic labels update automatically when your dashboard or graph refreshes. By default, the dynamic values that you add to labels appear at the beginning of the labels. For more information, see Use dynamic labels. b. c. d. To change the color of a metric, choose the color square that's next to the metric. To change the statistic, choose the statistic value under the Statistic column, and then choose a new value. For more information, see Statistics. To change the period, choose the period value under the Period column, and then choose a new value. 8. To add or edit horizontal annotations, choose Graph options: a. b. c. To add a horizontal annotation, choose Add horizontal annotation. For Label, choose the pencil icon next to the current annotation. Then enter your new annotation. After you enter your annotation, choose the check mark icon. For Value, choose the pencil icon next to the current metric value. Then enter your new metric value. After you enter your value, select the check mark icon. Editing a graph 66 Amazon CloudWatch User Guide d. For Fill, choose the dropdown under the column, and then specify how your annotation will use shading. You can choose None, Above, Between, or Below. If you choose Between, a new label and value field appears. Tip You can change the fill color by choosing the color square next to the annotation. e. For Axis, specify whether your annotation appears on the left or right side of the Y- axis. f. To hide an annotation, deselect the check box next to the annotation that you want to hide on the graph. g. To delete an annotation, choose X under the Actions column. Note You can repeat these steps to add multiple horizontal annotations to the same graph. 9. To add or edit vertical annotations, choose Graph options: a. b. c. d. To add a vertical annotation, choose Add vertical annotation. For Label, choose the pencil icon next to the current annotation. Then enter your new annotation. After you enter your annotation, choose the check mark icon. Tip To show only the date and time, leave the label field blank. For Date, choose the pencil icon next to the current date and time. Then enter the new date and time. For Fill, choose the dropdown under the column, and then specify how your annotation will use shading. You can choose None, Above, Between, or Below. If you choose Between, a new label and value field appears. Editing a graph 67 Amazon CloudWatch User Guide Tip You can change the fill color by choosing the color square next to the annotation. Note You can repeat these steps to add multiple vertical annotations to the same graph. e. To hide an annotation, deselect the check box next to the annotation that you want to hide on the graph. f. To delete an annotation, choose X under the Actions column. 10. To customize the Y-axis, choose Graph options. Under Left Y-axis, you can enter a custom label for Label. If the graph displays values on the right Y-axis, you can customize that label, too. You also can set minimums and maximums on the Y-axis values, so that the graph displays only the value range that you specify. 11. When you finish |
acw-ug-032 | acw-ug.pdf | 32 | multiple vertical annotations to the same graph. e. To hide an annotation, deselect the check box next to the annotation that you want to hide on the graph. f. To delete an annotation, choose X under the Actions column. 10. To customize the Y-axis, choose Graph options. Under Left Y-axis, you can enter a custom label for Label. If the graph displays values on the right Y-axis, you can customize that label, too. You also can set minimums and maximums on the Y-axis values, so that the graph displays only the value range that you specify. 11. When you finish making changes, choose Update widget. To hide or change the position of a graph legend 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the upper-right corner of the graph that you want to edit, and choose Widget actions. Choose Legend, and select Hidden, Bottom, or Right. To temporarily hide metrics for a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. Select the color square for the metric that you want to hide in the graph's footer. An X appears in the color square when you hover over it, and the square turns gray when you choose it. Editing a graph 68 Amazon CloudWatch User Guide 4. To restore the hidden metric, clear the X in the gray square. Renaming a graph on a CloudWatch dashboard You can change the default name that CloudWatch assigns to a graph on your dashboard. To rename a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the title of the graph and choose Widget actions and Edit. 4. On the Edit graph screen, near the top, choose the title of the graph. 5. For Title, enter a new name and choose Ok (check mark). In the lower-right corner of the Edit graph screen, choose Update widget. Moving a graph on a CloudWatch dashboard To move a graph on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Do one of the following: • Hover over the title of the graph until the selection icon appears. Select and drag the graph to a new location on the dashboard. • To move the widget to either the top left or bottom left of the dashboard, choose the vertical ellipsis at the upper right of the widget to open the Widget actions menu. Then choose Move, and choose where to move the widget to. 4. Choose Save dashboard. Changing the size of graphs on CloudWatch dashboards To change the size of a graph 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. Renaming a graph 69 Amazon CloudWatch User Guide 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. To increase or decrease the size, hover over the graph and drag the lower right corner of the graph. Stop dragging the corner when you have the size that you want. 4. Choose Save dashboard. Changing the size of a graph temporarily on a CloudWatch dashboard To enlarge a graph temporarily 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. Select the graph. Alternatively, hover over the title of the graph and choose Widget actions, Enlarge. Add a metrics explorer widget to a CloudWatch dashboard The following steps explain how to add a metrics explorer widget to a dashboard using the console. You can also add it programmatically or by using AWS CloudFormation. For more information, see Metrics Explorer Widget Object Definition and AWS::CloudWatch::Dashboard. To add a metrics explorer widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of the dashboard where you want to add the metrics explorer widget. 4. Choose the + symbol. 5. Choose Explorer and then choose Next. Note You must be opted in to the new dashboard view to be able to add a Metrics Explorer widget. To opt in, choose Dashboards in the navigation pane, then choose try out the new interface in the banner at the top of the page. 6. Do one of the following: Changing the size of a graph temporarily 70 Amazon CloudWatch User Guide • • To use a template, choose Pre-filled Explorer widget and then select a template to use. To create a custom visualization, choose Empty Explorer widget. 7. Choose Create. If you used a template, the widget appears on your dashboard with the selected metrics. If you're satisfied |
acw-ug-033 | acw-ug.pdf | 33 | view to be able to add a Metrics Explorer widget. To opt in, choose Dashboards in the navigation pane, then choose try out the new interface in the banner at the top of the page. 6. Do one of the following: Changing the size of a graph temporarily 70 Amazon CloudWatch User Guide • • To use a template, choose Pre-filled Explorer widget and then select a template to use. To create a custom visualization, choose Empty Explorer widget. 7. Choose Create. If you used a template, the widget appears on your dashboard with the selected metrics. If you're satisfied with the explorer widget and the dashboard, choose Save dashboard. If you did not use a template, continue to the following steps. 8. In the new widget under Explorer, in the Metrics box, choose a single metric or all the available metrics from a service. After you choose a metric, you can optionally repeat this step to add more metrics. 9. For each metric selected, CloudWatch displays the statistic that it will use immediately after the metric name. To change this, choose the statistic name and then choose the statistic that you want. 10. Under From, choose a tag or a resource property to filter your results. After you do this, you can optionally repeat this step to choose more tags or resource properties. If you choose multiple values of the same property, such as two EC2 instance types, the explorer displays all the resources that match either chosen property. It's treated as an OR operation. If you choose different properties or tags, such as the Production tag and the M5 instance type, only the resources that match all of these selections are displayed. This is treated as an AND operation. 11. (Optional) For Aggregate by, choose a statistic to use to aggregate the metrics. Then, next to for, choose how to aggregate the metric from the list. You can aggregate together all the resources that are currently displayed, or aggregate by a single tag or resource property. Depending on how you choose to aggregate, the result may be a single time series or multiple time series. 12. Under Split by, you can choose to split a single graph with multiple time series into multiple graphs. The split can be made by a variety of criteria, which you choose under Split by. 13. Under Graph options, you can refine the graph by changing the period, the type of graph, the legend placement, and the layout. Add a metrics explorer widget 71 Amazon CloudWatch User Guide 14. If you're satisfied with the explorer widget and the dashboard, choose Save dashboard. Adding a line graph widget to a CloudWatch dashboard To add a line widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol, and select Line. 4. Choose Metrics. 5. Choose Browse, and select the metric that you want to graph. 6. Choose Create widget, and then choose Save dashboard. Removing a line graph widget from a CloudWatch dashboard To remove a line graph widget from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper-right corner of the line widget that you want to remove, choose Widget actions, and then choose Delete. 4. Choose Save dashboard. Adding a number widget to a CloudWatch dashboard Note Only the new interface supports the sparkline feature. When you create a number widget, the sparkline feature is automatically included. To add a number widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. Adding a line graph widget 72 Amazon CloudWatch User Guide 3. Choose the + symbol, and select Number. 4. 5. 6. 7. In the Browse tab, search or browse for the metric that you want to display. (Optional) To change the color of the sparkline feature, choose Graphed metrics, and select the color box next to the metric label. A menu appears where you can choose a different color or enter a six-digit hex color code to specify a color. (Optional) To turn off the sparkline feature, choose Options. Under Sparkline, the check box. (Optional) To change your number widget's time range, select one of the predefined time ranges in the upper area of the widget. The time ranges span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). To set your own time range, choose Custom. • (Optional) To have this widget keep using this time range that you select, even if the time range for the rest of the dashboard is later changed, choose Persist time range. 8. (Optional) |
acw-ug-034 | acw-ug.pdf | 34 | code to specify a color. (Optional) To turn off the sparkline feature, choose Options. Under Sparkline, the check box. (Optional) To change your number widget's time range, select one of the predefined time ranges in the upper area of the widget. The time ranges span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). To set your own time range, choose Custom. • (Optional) To have this widget keep using this time range that you select, even if the time range for the rest of the dashboard is later changed, choose Persist time range. 8. (Optional) To have the number widget display an aggregate (1h, 3h, 12h, 1d, 3d, or 1w). To set your own time range, choose Custom. • (Optional) To have this widget display an average of the metric value over the entire time range, instead of the most recent value, choose Options, Time range value shows the value from the entire time range. 9. Choose Create widget, and choose Save dashboard. Tip You can turn off the sparkline feature from the number widget on the dashboard screen. In the upper-right corner of the number widget that you want to modify, choose Widget actions. Select Sparkline, and then choose Hide sparkline. Removing a number widget from a CloudWatch dashboard To remove a number widget from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose the dashboard that contains the number widget that you want to delete. Removing a number widget 73 Amazon CloudWatch User Guide 3. In the upper-right corner of the number widget that you want to remove, choose Widget actions, and then choose Delete. 4. Choose Save dashboard. Adding a gauge widget to a CloudWatch dashboard Note Only the new interface in the CloudWatch console supports creation of the gauge widget. You must set a gauge range when you create this widget. To add a gauge widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. From the dashboard screen, choose the + symbol, and then select Gauge. 4. Choose Browse, and then select the metric that you want to graph. 5. Choose Options. Under Gauge range, set values for Min and Max. For percentages, such as CPU utilization, we recommend that you set the values for Min to 0 and Max to 100. 6. (Optional) To change the color of the gauge widget, choose Graphed metrics and select the color box next to the metric label. A menu appears where you can choose a different color or enter a six-digit hex color code to specify a color. 7. Choose Create widget, and choose Save dashboard. Removing a gauge widget from a CloudWatch dashboard To remove a gauge widget from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose the dashboard that contains the gauge widget you want to delete. In the upper-right corner of the gauge widget that you want to delete, choose Widget actions, and choose Delete. Adding a gauge widget 74 Amazon CloudWatch 4. Choose Save dashboard. User Guide Using a custom widget on a CloudWatch dashboard A custom widget is a CloudWatch dashboard widget that can call any AWS Lambda function with custom parameters. It then displays the returned HTML or JSON. Custom widgets are a simple way to build a custom data view on a dashboard. If you can write Lambda code and create HTML, you can create a useful custom widget. Additionally, Amazon provides several prebuilt custom widgets that you can create without any code. When you create a Lambda function to use as a custom widget, we strongly recommend that you include the prefix customWidget in the function name. This helps you know which of your Lambda functions are safe to use when you add custom widgets to your dashboard. Custom widgets behave like other widgets on your dashboard. They can be refreshed and auto- refreshed, resized, and moved around. They react to the time range of the dashboard. If you have set up CloudWatch console cross-account functionality, you can add a custom widget created in one account to dashboards in other accounts. For more information, see Cross-account cross-Region CloudWatch console. You can also use custom widgets on your own website by using the CloudWatch dashboard sharing feature. For more information, see Sharing CloudWatch dashboards. Topics • Details about custom widgets in CloudWatch • Security and JavaScript for custom CloudWatch widgets • Interactivity in the custom widget in CloudWatch • Creating a custom widget for a CloudWatch dashboard • Sample custom widgets for a CloudWatch dashboard Details about custom widgets in CloudWatch Custom widgets work as follows: 1. The CloudWatch |
acw-ug-035 | acw-ug.pdf | 35 | add a custom widget created in one account to dashboards in other accounts. For more information, see Cross-account cross-Region CloudWatch console. You can also use custom widgets on your own website by using the CloudWatch dashboard sharing feature. For more information, see Sharing CloudWatch dashboards. Topics • Details about custom widgets in CloudWatch • Security and JavaScript for custom CloudWatch widgets • Interactivity in the custom widget in CloudWatch • Creating a custom widget for a CloudWatch dashboard • Sample custom widgets for a CloudWatch dashboard Details about custom widgets in CloudWatch Custom widgets work as follows: 1. The CloudWatch dashboard calls the Lambda function containing the widget code. It passes in any custom parameters that are defined in the widget. Using a custom widget 75 Amazon CloudWatch User Guide 2. The Lambda function returns a string of HTML, JSON, or Markdown. Markdown is returned as JSON in the following format: {"markdown":"markdown content"} 3. The dashboard displays the returned HTML or JSON. If the function returns HTML, most HTML tags are supported. You can use Cascading Style Sheets (CSS) styles and Scalable Vector Graphics (SVG) to build sophisticated views. The default style of HTML elements such as links and tables follow the styling of CloudWatch dashboards. You can customize this style by using inline styles, using the <style> tag. You can also deactivate the default styles by including a single HTML element with the class of cwdb-no- default-styles. The following example deactivates default styles: <div class="cwdb-no- default-styles"></div>. Every call by a custom widget to Lambda includes a widgetContext element with the following contents, to provide the Lambda function developer with useful context information. { "widgetContext": { "dashboardName": "Name-of-current-dashboard", "widgetId": "widget-16", "accountId": "012345678901", "locale": "en", "timezone": { "label": "UTC", "offsetISO": "+00:00", "offsetInMinutes": 0 }, "period": 300, "isAutoPeriod": true, "timeRange": { "mode": "relative", "start": 1627236199729, "end": 1627322599729, "relativeStart": 86400012, "zoom": { "start": 1627276030434, "end": 1627282956521 Using a custom widget 76 User Guide Amazon CloudWatch } }, "theme": "light", "linkCharts": true, "title": "Tweets for Amazon website problem", "forms": { "all": {} }, "params": { "original": "param-to-widget" }, "width": 588, "height": 369 } } Default CSS styling Custom widgets provide the following default CSS styling elements: • You can use the CSS class btn to add a button. It turns an anchor (<a>) into a button as in the following example: <a class="btn" href=https://amazon.com”>Open Amazon</a> • You can use the CSS class btn btn-primary to add a primary button. • The following elements are styled by default: table, select, headers (h1, h2, and h3), preformatted text (pre), input, and text area. Using the describe parameter We strongly recommend that you support the describe parameter in your functions, even if it just returns an empty string. If you don't support it, and it is called in the custom widget, it displays widget content as if it was documentation. If you include the describe parameter, the Lambda function returns the documentation in Markdown format and does nothing else. When you create a custom widget in the console, after you select the Lambda function a Get documentation button appears. If you choose this button, the function is invoked with the Using a custom widget 77 Amazon CloudWatch User Guide describe parameter and the function's documentation is returned. If the documentation is well-formatted in markdown, CloudWatch parses the first entry in the documentation that is surrounded by three single backtick characters (```) in YAML. Then, it automatically populates the documentation in the parameters. The following is an example of such well-formatted documentation. ``` yaml echo: <h1>Hello world</h1> ``` Security and JavaScript for custom CloudWatch widgets For security reasons, JavaScript is not allowed in the returned HTML. Removing the JavaScript prevents permission escalation issues, where the writer of the Lambda function injects code that could run with higher permissions than the user viewing the widget on the dashboard. If the returned HTML contains any JavaScript code or other known security vulnerabilities, it is cleaned from the HTML before it is rendered on the dashboard. For example, the <iframe> and <use> tags are not allowed and are removed. Custom Widgets won't run by default in a dashboard. Instead, you must explicitly allow a custom widget to run if you trust the Lambda function that it invokes. You can choose to allow it once or allow always, for both individual widgets and entire dashboard. You can also deny permission for individual widgets and the entire dashboard. Interactivity in the custom widget in CloudWatch Even though JavaScript is not allowed, there are other ways to allow interactivity with the returned HTML. • Any element in the returned HTML can be tagged with special configuration in a <cwdb- action> tag, which can display information in pop-ups, ask for confirmation on clicks, and call any Lambda function when that element is chosen. For example, |
acw-ug-036 | acw-ug.pdf | 36 | the Lambda function that it invokes. You can choose to allow it once or allow always, for both individual widgets and entire dashboard. You can also deny permission for individual widgets and the entire dashboard. Interactivity in the custom widget in CloudWatch Even though JavaScript is not allowed, there are other ways to allow interactivity with the returned HTML. • Any element in the returned HTML can be tagged with special configuration in a <cwdb- action> tag, which can display information in pop-ups, ask for confirmation on clicks, and call any Lambda function when that element is chosen. For example, you can define buttons that call any AWS API using a Lambda function. The returned HTML can be set to either replace the existing Lambda widget's content, or display inside a modal. • The returned HTML can include links that open new consoles, open other customer pages, or load other dashboards. • The HTML can include the title attribute for an element, which gives additional information if the user hovers over that element. Using a custom widget 78 Amazon CloudWatch User Guide • The element can include CSS selectors, such as :hover, which can invoke animations or other CSS effects. You can also show or hide elements in the page. <cwdb-action> definition and usage The <cwdb-action> element defines a behavior on the immediately previous element. The content of the <cwdb-action> is either HTML to display or a JSON block of parameters to pass to a Lambda function. The following is an example of a <cwdb-action> element. <cwdb-action action="call|html" confirmation="message" display="popup|widget" endpoint="<lambda ARN>" event="click|dblclick|mouseenter"> html | params in JSON </cwdb-action> • action— Valid values are call, which calls a Lambda function, and html, which displays any HTML contained within <cwdb-action>. The default is html. • confirmation— Displays a confirmation message that must be acknowledged before the action is taken, allowing the customer to cancel. • display— Valid values are popup and widget, which replaces the content of the widget itself. The default is widget. • endpoint— The Amazon Resource Name (ARN) of the Lambda function to call. This is required if action is call. • event— Defines the event on the previous element that invokes the action. Valid values are click, dblclick, and mouseenter. The mouseenter event can be used only in combination with the html action. The default is click. Examples The following is an example of how to use the <cwdb-action> tag to create a button that reboots an Amazon EC2 instance using a Lambda function call. It displays the success or failure of the call in a pop-up. Using a custom widget 79 Amazon CloudWatch User Guide <a class="btn">Reboot Instance</a> <cwdb-action action="call" endpoint="arn:aws:lambda:us- east-1:123456:function:rebootInstance" display="popup"> { "instanceId": "i-342389adbfef" } </cwdb-action> The next example displays more information in a pop-up. <a>Click me for more info in popup</a> <cwdb-action display="popup"> <h1>Big title</h1> More info about <b>something important</b>. </cwdb-action> This example is a Next button that replaces the content of a widget with a call to a Lambda function. <a class="btn btn-primary">Next</a> <cwdb-action action="call" endpoint="arn:aws:lambda:us- east-1:123456:function:nextPage"> { "pageNum": 2 } </cwdb-action> Creating a custom widget for a CloudWatch dashboard To create a custom widget, you can use one of the samples provided by AWS, or you can create your own. The AWS samples include samples in both JavaScript and Python, and are created by a AWS CloudFormation stack. For a list of samples, see Sample custom widgets for a CloudWatch dashboard. To create a custom widget in a CloudWatch dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol. 4. Choose Custom widget. 5. Use one of the following methods: • To use a sample custom widget provided by AWS, do the following: Using a custom widget 80 Amazon CloudWatch User Guide a. Select the sample in the dropdown box. The AWS CloudFormation console launches in a new browser. In the AWS CloudFormation console, do the following: b. (Optional) Customize the AWS CloudFormation stack name. c. Make selections for any parameters used by the sample. d. Select I acknowledge that AWS CloudFormation might create IAM resources, and choose Create stack. • To create your own custom widget provided by AWS, do the following: a. Choose Next. b. Choose to either select your Lambda function from a list, or enter its Amazon Resource Name (ARN). If you select it from a list, also specify the Region where the function is and the version to use. c. d. e. For Parameters, make selections for any parameters used by the function. Enter a title for the widget. For Update on, configure when the widget should be updated (when the Lambda function should be called again). This can be one or more of the following: Refresh to update it when |
acw-ug-037 | acw-ug.pdf | 37 | widget provided by AWS, do the following: a. Choose Next. b. Choose to either select your Lambda function from a list, or enter its Amazon Resource Name (ARN). If you select it from a list, also specify the Region where the function is and the version to use. c. d. e. For Parameters, make selections for any parameters used by the function. Enter a title for the widget. For Update on, configure when the widget should be updated (when the Lambda function should be called again). This can be one or more of the following: Refresh to update it when the dashboard auto-refreshes, Resize to update it whenever the widget is resized, or Time Range to update it whenever the dashboard's time range is adjusted, including when graphs are zoomed into. f. If you are satisfied with the preview, choose Create widget. Sample custom widgets for a CloudWatch dashboard AWS provides sample custom widgets in both JavaScript and Python. You can create these sample widgets by using the link for each widget in this list. Alternatively, you can create and customize a widget by using the CloudWatch console. The links in this list open an AWS CloudFormation console and use an AWS CloudFormation quick-create link to create the custom widget. You can also access the custom widget samples on GitHub. Following this list, complete examples of the Echo widget are shown for each language. Using a custom widget 81 Amazon CloudWatch JavaScript Sample custom widgets in JavaScript User Guide • Echo – A basic echoer that you can use to test how HTML appears in a custom widget, without having to write a new widget. • Hello world – A very basic starter widget. • Custom widget debugger – A debugger widget that displays useful information about the Lambda runtime environment. • Query CloudWatch Logs Insights – Run and edit CloudWatch Logs Insights queries. • Run Amazon Athena queries – Run and edit Athena queries. • Call AWS API – Call any read-only AWS API and display the results in JSON format. • Fast CloudWatch bitmap graph – Render CloudWatch graphs using on the server side, for fast display. • Text widget from CloudWatch dashboard – Displays the first text widget from the specified CloudWatch dashboard. • CloudWatch metric data as a table – Displays raw CloudWatch metric data in a table. • Amazon EC2 table – Displays the top EC2 instances by CPU utilization. This widget also includes a Reboot button, which is disabled by default. • AWS CodeDeploy deployments – Displays CodeDeploy deployments. • AWS Cost Explorer report – Displays a report on the cost of each AWS service for a selected time range. • Display content of external URL – Displays the content of an externally accessible URL. • Display an Amazon S3 object – Displays an object in an Amazon S3 bucket in your account. • Simple SVG pie chart – Example of a graphical SVG-based widget. Python Sample custom widgets in Python • Echo – A basic echoer which you can use to test how HTML appears in a custom widget, without having to write a new widget. • Hello world – A very basic starter widget. Using a custom widget 82 Amazon CloudWatch User Guide • Custom widget debugger – A debugger widget that displays useful information about the Lambda runtime environment. • Call AWS API – Call any read-only AWS API and display the results in JSON format. • Fast CloudWatch bitmap graph – Render CloudWatch graphs using on the server side, for fast display. • Send dashboard snapshot by email – Take a snapshot of the current dashboard and send it to email recipients. • Send dashboard snapshot to Amazon S3 – Take a snapshot of the current dashboard and store it in Amazon S3. • Text widget from CloudWatch dashboard – Displays the first text widget from the specified CloudWatch dashboard. • Display content of external URL – Displays the content of an externally accessible URL. • RSS reader – Displays RSS feeds. • Display an Amazon S3 object – Displays an object in an Amazon S3 bucket in your account. • Simple SVG pie chart – Example of a graphical SVG-based widget. Echo widget in JavaScript The following is the Echo sample widget in JavaScript. const DOCS = ` ## Echo A basic echo script. Anything passed in the \`\`\`echo\`\`\` parameter is returned as the content of the custom widget. ### Widget parameters Param | Description ---|--- **echo** | The content to echo back ### Example parameters \`\`\` yaml echo: <h1>Hello world</h1> \`\`\` `; exports.handler = async (event) => { if (event.describe) { Using a custom widget 83 Amazon CloudWatch return DOCS; } User Guide let widgetContext = JSON.stringify(event.widgetContext, null, 4); widgetContext = widgetContext.replace(/</g, '<'); widgetContext = widgetContext.replace(/>/g, '>'); return |
acw-ug-038 | acw-ug.pdf | 38 | SVG-based widget. Echo widget in JavaScript The following is the Echo sample widget in JavaScript. const DOCS = ` ## Echo A basic echo script. Anything passed in the \`\`\`echo\`\`\` parameter is returned as the content of the custom widget. ### Widget parameters Param | Description ---|--- **echo** | The content to echo back ### Example parameters \`\`\` yaml echo: <h1>Hello world</h1> \`\`\` `; exports.handler = async (event) => { if (event.describe) { Using a custom widget 83 Amazon CloudWatch return DOCS; } User Guide let widgetContext = JSON.stringify(event.widgetContext, null, 4); widgetContext = widgetContext.replace(/</g, '<'); widgetContext = widgetContext.replace(/>/g, '>'); return `${event.echo || ''}<pre>${widgetContext}</pre>`; }; Echo widget in Python The following is the Echo sample widget in Python. import json DOCS = """ ## Echo A basic echo script. Anything passed in the ```echo``` parameter is returned as the content of the custom widget. ### Widget parameters Param | Description ---|--- **echo** | The content to echo back ### Example parameters ``` yaml echo: <h1>Hello world</h1> ```""" def lambda_handler(event, context): if 'describe' in event: return DOCS echo = event.get('echo', '') widgetContext = event.get('widgetContext') widgetContext = json.dumps(widgetContext, indent=4) widgetContext = widgetContext.replace('<', '<') widgetContext = widgetContext.replace('>', '>') return f'{echo}<pre>{widgetContext}</pre>' Echo widget in Java Using a custom widget 84 Amazon CloudWatch User Guide The following is the Echo sample widget in Java. package example; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class Handler implements RequestHandler<Event, String>{ static String DOCS = "" + "## Echo\n" + "A basic echo script. Anything passed in the ```echo``` parameter is returned as the content of the custom widget.\n" + "### Widget parameters\n" + "Param | Description\n" + "---|---\n" + "**echo** | The content to echo back\n\n" + "### Example parameters\n" + "```yaml\n" + "echo: <h1>Hello world</h1>\n" + "```\n"; Gson gson = new GsonBuilder().setPrettyPrinting().create(); @Override public String handleRequest(Event event, Context context) { if (event.describe) { return DOCS; } return (event.echo != null ? event.echo : "") + "<pre>" + gson.toJson(event.widgetContext) + "</pre>"; } } class Event { public boolean describe; public String echo; public Object widgetContext; Using a custom widget 85 Amazon CloudWatch User Guide public Event() {} public Event(String echo, boolean describe, Object widgetContext) { this.describe = describe; this.echo = echo; this.widgetContext = widgetContext; } } Adding a text widget to a CloudWatch dashboard To add a text widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol. 4. Choose Text. 5. 6. For Markdown, add and format your text using Markdown and choose Create widget. To make the text widget transparent, choose Transparent background. 7. Choose Save dashboard. Editing a text widget on a CloudWatch dashboard To edit a text widget on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the upper-right corner of the text block and choose Widget actions. Then, choose Edit. 4. Update the text as needed and choose Update widget. 5. Choose Save dashboard. Adding a text widget 86 Amazon CloudWatch User Guide Removing a text widget from a CloudWatch dashboard To remove a text widget from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the upper-right corner of the text block and choose Widget actions. Then, choose Delete. 4. Choose Save dashboard. Adding an alarm to a CloudWatch dashboard To add a single alarm, including its graph, to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. 5. 6. In the navigation pane, choose Alarms, select the alarm to add, and then choose Add to Dashboard. Select a dashboard, choose a widget type (Line, Stacked area, or Number), and then choose Add to dashboard. To see your alarm on the dashboard, choose Dashboards in the navigation pane and select the dashboard. (Optional) To temporarily make an alarm graph larger, select the graph. (Optional) To change the widget type, hover over the title of the graph, choose Widget actions, and then choose Widget type. Adding an alarm status widget to a CloudWatch dashboard To add an alarm status widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol. 4. Choose Alarm status. Removing a text widget 87 Amazon CloudWatch User Guide 5. Select the check boxes next to the alarms that you want to add to the widget, and then choose Create widget. 6. Choose Add to dashboard. Removing an alarm widget from a CloudWatch dashboard To remove an alarm widget from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then |
acw-ug-039 | acw-ug.pdf | 39 | widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose the + symbol. 4. Choose Alarm status. Removing a text widget 87 Amazon CloudWatch User Guide 5. Select the check boxes next to the alarms that you want to add to the widget, and then choose Create widget. 6. Choose Add to dashboard. Removing an alarm widget from a CloudWatch dashboard To remove an alarm widget from a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Hover over the widget, choose Widget actions, and then choose Delete. 4. Choose Save dashboard. If you attempt to navigate away from the dashboard before you save your changes, you're prompted to either save or discard your changes. Using a data table widget in a CloudWatch dashboard Table properties A data table has a default set of properties that don’t require any changes to be made to the options or source. These properties include a sticky label column, all summary columns enabled, datapoints rounded, and their units converted. Each data table widget can have the following properties. The information about each property includes how to configure it in the JSON source of the dashboard. For more information about dashboard JSON, see Dashboard Body Structure and Syntax. Summary Summary columns are a new property introduced with the data table widget. These columns are a specific subset of summaries of your current table. For example, the Sum summary is a sum of all displayed datapoints in its row. The summary columns are not the same as CloudWatch statistics. Represented in source as: "table": { "summaryColumns": [ "MIN", "MAX", Removing an alert widget 88 Amazon CloudWatch User Guide "SUM", "AVG" ] }, Thresholds Use this to apply thresholds to your table. When a data point falls within a threshold, its cell is highlighted with the threshold color. Represented in source as: "annotations": { "horizontal": [ { "label": string, "value": int, "fill": "above" | "below" } ] } Unit in label column To display what unit is associated with the metric, you can enable this option to display the unit in the label column beside the label. Represented in source as: "yAxis": { "left": { "showUnits": true | false } } Invert rows and columns This transforms the table so that the datapoints swap from columns to rows, and the metrics become columns. Represented in source as: "table": { "layout": "vertical" | "horizontal" } Using a data table widget 89 Amazon CloudWatch Sticky summary columns User Guide This makes the summary columns sticky, so that they remain in view while you scroll. The label is already sticky. Represented in source as: "table": { "stickySummary": true | false } Display only summary columns This prevents the columns of datapoints from being displayed, so that only the label and summary columns are displayed. Represented in source as: "table": { "showTimeSeriesData": false | true } Live data Displays the most recent data point, even if it is not yet fully aggregated. Represented in source as: "liveData": true | false Number widget format Displays as many digits as can fit in the cell, before rounding and converting. Represented in source as: "singleValueFullPrecision": true | false Adding a data table widget to a CloudWatch dashboard To add a data table widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards and then choose a dashboard. 3. Choose the + button, select Data table, and choose Next. Using a data table widget 90 Amazon CloudWatch User Guide 4. 5. In the Browse tab, search or browse for the metrics that you want to display in the table widget. Then select the metrics. (Optional) To change the layout of the table, choose the Options tab and select Invert rows and columns. You can also use the Options tab to change what columns appear in the table and display the unit being used in the Label column. Tip To display more accurate thresholds, choose Show as many digits as can fit before rounding. 6. (Optional) To change your data table widget's time range, select one of the predefined time ranges in the upper area of the widget. The time ranges span from 1 hour to 1 week. To set your own time range, choose Custom. 7. (Optional) To change your data table widget's time range, select one of the predefined time ranges in the upper area of the widget. The time ranges span from 1 hour to 1 week. To set your own time range, choose Custom. 8. (Optional) To have this widget keep using the time range that you select, even if the time range for the rest of |
acw-ug-040 | acw-ug.pdf | 40 | widget's time range, select one of the predefined time ranges in the upper area of the widget. The time ranges span from 1 hour to 1 week. To set your own time range, choose Custom. 7. (Optional) To change your data table widget's time range, select one of the predefined time ranges in the upper area of the widget. The time ranges span from 1 hour to 1 week. To set your own time range, choose Custom. 8. (Optional) To have this widget keep using the time range that you select, even if the time range for the rest of the dashboard is later changed, choose Persist time range. 9. Choose Create widget and then choose Save dashboard. Removing a data table widget from a CloudWatch dashboard To remove a data table widget to a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper-right corner of the widget that you want to remove, choose Widget actions, Delete. 4. Choose Save dashboard. Linking graphs on a CloudWatch dashboard Link graphs on a CloudWatch dashboard so that changes in time are reflected on all graphs. Linking graphs 91 Amazon CloudWatch User Guide To link the graphs on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Choose Actions and then Link graphs. Unlinking graphs on a CloudWatch dashboard To unlink the graphs on a dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. Clear Actions and then Link graphs. Sharing CloudWatch dashboards You can share your CloudWatch dashboards with people who do not have direct access to your AWS account. This enables you to share dashboards across teams, with stakeholders, and with people external to your organization. You can even display dashboards on big screens in team areas, or embed them in Wikis and other webpages. Warning All people who you share the dashboard with are granted the permissions listed in Permissions that are granted to people who you share the dashboard with for the account. If you share the dashboard publicly, then everyone who has the link to the dashboard has these permissions. The cloudwatch:GetMetricData and ec2:DescribeTags permissions cannot be scoped down to specific metrics or EC2 instances, so the people with access to the dashboard can query all CloudWatch metrics and the names and tags of all EC2 instances in the account. When you share dashboards, you can designate who can view the dashboard in three ways: Unlinking graphs 92 Amazon CloudWatch User Guide • Share a single dashboard and designate as many as five email addresses of people who can view the dashboard. Each of these users creates their own password that they must enter to view the dashboard. • Share a single dashboard publicly, so that anyone who has the link can view the dashboard. • Share all the CloudWatch dashboards in your account and specify a third-party single sign-on (SSO) provider for dashboard access. All users who are members of this SSO provider's list can access all the dashboards in the account. To enable this, you integrate the SSO provider with Amazon Cognito. The SSO provider must support Security Assertion Markup Language (SAML). For more information about Amazon Cognito, see What is Amazon Cognito? Sharing a dashboard doesn't incur charges, but widgets inside a shared dashboard incur charges at standard CloudWatch rates. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. When you share a dashboard, Amazon Cognito resources are created in the US East (N. Virginia) Region. Important Do not modify resource names and identifiers that are created by the dashboard sharing process. This includes Amazon Cognito and IAM resources. Modifying these resources can cause unexpected and incorrect functionality of shared dashboards. Note If you share a dashboard that has metric widgets with alarm annotations, the people that you share the dashboard with will not see those widgets. They will instead see a blank widget with text saying that the widget is not available. You will still see metric widgets with alarm annotations when you view the dashboard yourself. Permissions required to share a dashboard To be able to share dashboards using any of the following methods and to see which dashboards have already been shared, you must be signed on as a user or with an IAM role that has certain permissions. Permissions required to share a dashboard 93 Amazon CloudWatch User Guide To be able to share dashboards, your user or IAM role must include the permissions included in the following policy statement: { "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:CreatePolicy", "iam:AttachRolePolicy", "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/service-role/CWDBSharing*", "arn:aws:iam::*:policy/*" ] }, { "Effect": "Allow", "Action": |
acw-ug-041 | acw-ug.pdf | 41 | view the dashboard yourself. Permissions required to share a dashboard To be able to share dashboards using any of the following methods and to see which dashboards have already been shared, you must be signed on as a user or with an IAM role that has certain permissions. Permissions required to share a dashboard 93 Amazon CloudWatch User Guide To be able to share dashboards, your user or IAM role must include the permissions included in the following policy statement: { "Effect": "Allow", "Action": [ "iam:CreateRole", "iam:CreatePolicy", "iam:AttachRolePolicy", "iam:PassRole" ], "Resource": [ "arn:aws:iam::*:role/service-role/CWDBSharing*", "arn:aws:iam::*:policy/*" ] }, { "Effect": "Allow", "Action": [ "cognito-idp:*", "cognito-identity:*", ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "cloudwatch:GetDashboard", ], "Resource": [ "*" // or the ARNs of dashboards that you want to share ] } To be able to see which dashboards are shared, but not be able to share dashboards, a user or an IAM role can include a policy statement similar to the following: { "Effect": "Allow", "Action": [ Permissions required to share a dashboard 94 Amazon CloudWatch User Guide "cognito-idp:*", "cognito-identity:*" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "cloudwatch:ListDashboards", ], "Resource": [ "*" ] } Permissions that are granted to people who you share the dashboard with When you share a dashboard, CloudWatch creates an IAM role in the account which gives the following permissions to the people who you share the dashboard with: • cloudwatch:GetInsightRuleReport • cloudwatch:GetMetricData • cloudwatch:DescribeAlarms • ec2:DescribeTags Warning All people who you share the dashboard with are granted these permissions for the account. If you share the dashboard publicly, then everyone who has the link to the dashboard has these permissions. The cloudwatch:GetMetricData and ec2:DescribeTags permissions cannot be scoped down to specific metrics or EC2 instances, so the people with access to the dashboard can query all CloudWatch metrics and the names and tags of all EC2 instances in the account. Permissions that are granted to people who you share the dashboard with 95 Amazon CloudWatch User Guide When you share a dashboard, by default the permissions that CloudWatch creates restrict access to only the alarms and Contributor Insights rules that are on the dashboard when it is shared. If you add new alarms or Contributor Insights rules to the dashboard and want them to also be seen by the people who you shared the dashboard with, you must update the policy to allow these resources. Sharing a CloudWatch dashboard with specific users Use the steps in this section to share a dashboard with as many as five email addresses that you choose. Note By default, any CloudWatch Logs widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see logs table widgets. By default, any composite alarm widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see composite alarms. To share a dashboard with specific users 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of your dashboard. 4. Choose Actions, Share dashboard. 5. Next to Share your dashboard and require a username and password, choose Start sharing. 6. Under Add email addresses, enter the email addresses that you want to share the dashboard with. You can include as many as five email addresses. 7. When you have all the email addresses entered, read the agreement and select the confirmation box. Then choose Preview policy. 8. Confirm that the resources that will be shared are what you want, and choose Confirm and generate shareable link. Sharing one dashboard with specific users 96 Amazon CloudWatch User Guide 9. On the next page, choose Copy link to clipboard. You can then paste this link into email and send it to the invited users. They automatically receive a separate email with their user name and a temporary password to use to connect to the dashboard. Sharing a CloudWatch dashboard publicly Follow the steps in this section to share a dashboard publicly. This can be useful to display the dashboard on a big screen in a team room, or embed it in a Wiki page. Important Sharing a dashboard publicly makes it accessible to anyone who has the link, with no authentication. Do this only for dashboards that do not contain sensitive information. Note By default, any CloudWatch Logs widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see logs table widgets. By default, any composite alarm widgets on the dashboard are not visible to people who you share the dashboard with. For more information, |
acw-ug-042 | acw-ug.pdf | 42 | big screen in a team room, or embed it in a Wiki page. Important Sharing a dashboard publicly makes it accessible to anyone who has the link, with no authentication. Do this only for dashboards that do not contain sensitive information. Note By default, any CloudWatch Logs widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see logs table widgets. By default, any composite alarm widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see composite alarms. To share a dashboard publicly 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of your dashboard. 4. Choose Actions, Share dashboard. 5. Next to Share your dashboard publicly, choose Start sharing. 6. Enter Confirm in the text box. 7. Read the agreement and select the confirmation box. Then choose Preview policy. 8. Confirm that the resources that will be shared are what you want, and choose Confirm and generate shareable link. Sharing a dashboard publicly 97 Amazon CloudWatch User Guide 9. On the next page, choose Copy link to clipboard. You can then share this link. Anyone you share the link with can access the dashboard, without providing credentials. Sharing all CloudWatch dashboards in the account by using SSO Use the steps in this section to share all the dashboards in your account with users by using single sign-on (SSO). Note By default, any CloudWatch Logs widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see logs table widgets. By default, any composite alarm widgets on the dashboard are not visible to people who you share the dashboard with. For more information, see Allowing people that you share with to see composite alarms. To share your CloudWatch dashboards with users who are in an SSO provider's list 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of your dashboard. 4. Choose Actions, Share dashboard. 5. Choose Go to CloudWatch Settings. 6. If the SSO provider that you want isn't listed in Available SSO providers, choose Manage SSO providers and follow the instructions in Setting up SSO for CloudWatch dashboard sharing. Then return to the CloudWatch console and refresh the browser. The SSO provider that you enabled should now appear in the list. 7. Choose the SSO provider that you want in the Available SSO providers list. 8. Choose Save changes. Sharing all dashboards using SSO 98 Amazon CloudWatch User Guide Setting up SSO for CloudWatch dashboard sharing To set up dashboard sharing through a third-party single sign-on provider that supports SAML, follow these steps. Important We strongly recommend that you do not share dashboards using a non-SAML SSO provider. Doing so causes a risk of inadvertently allowing third parties to access your account's dashboards. To set up an SSO provider to enable dashboard sharing 1. Integrate the SSO provider with Amazon Cognito. For more information, see Integrating Third-Party SAML Identity Providers with Amazon Cognito User Pools. 2. Download the metadata XML file from your SSO provider. 3. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 4. 5. In the navigation pane, choose Settings. In the Dashboard sharing section, choose Configure. 6. Choose Manage SSO providers. This opens the Amazon Cognito console in the US East (N. Virginia) Region (us-east-1). If you don't see any User Pools, the Amazon Cognito console might have opened in a different Region. If so, change the Region to US East (N. Virginia) us-east-1 and proceed with the next steps. 7. Choose the CloudWatchDashboardSharing pool. 8. In the navigation pane, choose Social and external providers. 9. Choose Add identity provider. 10. Choose SAML. 11. Enter a name for your SSO provider in Provider name. 12. Choose Select file, and select the metadata XML file that you downloaded in step 1. 13. Choose Create provider. Setting up SSO 99 Amazon CloudWatch User Guide Seeing how many of your CloudWatch dashboards are shared You can use the CloudWatch console to see how many of your CloudWatch dashboards are currently being shared with others. To see how many of your dashboards are being shared 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Settings. The Dashboard sharing section displays how many dashboards are shared. To see which dashboards are shared, choose number dashboards shared under Username and password and under Public dashboards. Seeing which of your CloudWatch dashboards are shared You can use the CloudWatch console to see which of your dashboards are currently being shared with others. |
acw-ug-043 | acw-ug.pdf | 43 | You can use the CloudWatch console to see how many of your CloudWatch dashboards are currently being shared with others. To see how many of your dashboards are being shared 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Settings. The Dashboard sharing section displays how many dashboards are shared. To see which dashboards are shared, choose number dashboards shared under Username and password and under Public dashboards. Seeing which of your CloudWatch dashboards are shared You can use the CloudWatch console to see which of your dashboards are currently being shared with others. To see which of your dashboards are being shared 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Dashboards. In the list of dashboards, see the Share column. Dashboards that have the icon in this column filled in are currently being shared. To see which users a dashboard is being shared with, choose the dashboard name, and then choose Actions, Share dashboard. The Share dashboard dashboard name page displays how the dashboard is being shared. If you want, you can stop sharing the dashboard by choosing Stop sharing. Stopping sharing one or more CloudWatch dashboards You can stop sharing a single shared dashboard, or stop sharing all shared dashboards at once. To stop sharing a single dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. Seeing how many of your dashboards are shared 100 Amazon CloudWatch User Guide 2. In the navigation pane, choose Dashboards. 3. Choose the name of the shared dashboard. 4. Choose Actions, Share dashboard. 5. Choose Stop sharing. 6. In the confirmation box, choose Stop sharing. To stop sharing all shared dashboards 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Settings. In the Dashboard sharing section, choose Stop sharing all dashboards. In the confirmation box, choose Stop sharing all dashboards. Reviewing shared CloudWatch dashboard permissions and changing permission scope Use the steps in this section if you want to review the permissions of the users of your shared dashboards, or change the scope of shared dashboard permissions. To review shared dashboard permissions 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of the shared dashboard. 4. Choose Actions, Share dashboard. 5. Under Resources, choose IAM Role. 6. 7. In the IAM console, choose the displayed policy. (Optional) To limit which alarms that shared dashboard users can see, choose Edit policy and move the cloudwatch:DescribeAlarms permission from its current position to a new Allow statement that lists the ARNs of only the alarms that you want to be seen by shared dashboard users. See the following example. { "Effect": "Allow", Reviewing and changing shared dashboard permissions 101 Amazon CloudWatch User Guide "Action": "cloudwatch:DescribeAlarms", "Resource": [ "AlarmARN1", "AlarmARN2" ] } If you do this, be sure to remove the cloudwatch:DescribeAlarms permission from a section of the current policy that looks like this: { "Effect": "Allow", "Action": [ "cloudwatch:GetInsightRuleReport", "cloudwatch:GetMetricData", "cloudwatch:DescribeAlarms", "ec2:DescribeTags" ], "Resource": "*" } 8. (Optional) To limit the scope of what Contributor Insights rules that shared dashboard users can see, choose Edit policy and move the cloudwatch:GetInsightRuleReport from its current position to a new Allow statement that lists the ARNs of only the Contributor Insights rules that you want to be seen by shared dashboard users. See the following example. { "Effect": "Allow", "Action": "cloudwatch:GetInsightRuleReport", "Resource": [ "PublicContributorInsightsRuleARN1", "PublicContributorInsightsRuleARN2" ] } If you do this, be sure to remove cloudwatch:GetInsightRuleReport from a section of the current policy that looks like this: { "Effect": "Allow", "Action": [ Reviewing and changing shared dashboard permissions 102 Amazon CloudWatch User Guide "cloudwatch:GetInsightRuleReport", "cloudwatch:GetMetricData", "cloudwatch:DescribeAlarms", "ec2:DescribeTags" ], "Resource": "*" } Allowing people that you share with to see composite alarms When you share a dashboard, by default the composite alarm widgets on the dashboard are not visible to the people who you share the dashboard with. For composite alarm widgets to be visible, you need to add a DescribeAlarms: * permission to the dashboard sharing policy. That permission would look like this: { "Effect": "Allow", "Action": "cloudwatch:DescribeAlarms", "Resource": "*" } Warning The preceding policy statement give access to all alarms in the account. To reduce the scope of cloudwatch:DescribeAlarms, you must use a Deny statement. You can add a Deny statement to the policy and specify the ARNs of the alarms that you want to lock down. That deny statement should look similar to the following: { "Effect": "Allow", "Action": "cloudwatch:DescribeAlarms", "Resource": "*" }, { "Effect": "Deny", "Action": "cloudwatch:DescribeAlarms", "Resource": [ "SensitiveAlarm1ARN", "SensitiveAlarm1ARN" ] Allowing people that you share with to see composite alarms 103 Amazon CloudWatch } User Guide Allowing people that you share with to see logs table widgets When you share a dashboard, by default the CloudWatch |
acw-ug-044 | acw-ug.pdf | 44 | in the account. To reduce the scope of cloudwatch:DescribeAlarms, you must use a Deny statement. You can add a Deny statement to the policy and specify the ARNs of the alarms that you want to lock down. That deny statement should look similar to the following: { "Effect": "Allow", "Action": "cloudwatch:DescribeAlarms", "Resource": "*" }, { "Effect": "Deny", "Action": "cloudwatch:DescribeAlarms", "Resource": [ "SensitiveAlarm1ARN", "SensitiveAlarm1ARN" ] Allowing people that you share with to see composite alarms 103 Amazon CloudWatch } User Guide Allowing people that you share with to see logs table widgets When you share a dashboard, by default the CloudWatch Logs Insights widgets that are on the dashboard are not visible to the people who you share the dashboard with. This affects both CloudWatch Logs Insights widgets that exist now and any that are added to the dashboard after you share it. If you want these people to be able to see CloudWatch Logs widgets, you must add permissions to the IAM role for dashboard sharing. To allow the people that you share a dashboard with to see the CloudWatch Logs widgets 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of the shared dashboard. 4. Choose Actions, Share dashboard. 5. Under Resources, choose IAM Role. 6. In the IAM console, choose the displayed policy. 7. Choose Edit policy and add the following statement. In the new statement, we recommend that you specify the ARNs of only the log groups that you want shared. See the following example. { "Effect": "Allow", "Action": [ "logs:FilterLogEvents", "logs:StartQuery", "logs:StopQuery", "logs:GetLogRecord", "logs:DescribeLogGroups" ], "Resource": [ "SharedLogGroup1ARN", "SharedLogGroup2ARN" ] Allowing people that you share with to see logs table widgets 104 Amazon CloudWatch }, 8. Choose Save Changes. User Guide If your IAM policy for dashboard sharing already includes those five permissions with * as the resource, we strongly recommend that you change the policy and specify only the ARNs of the log groups that you want shared. For example, if your Resource section for these permissions was the following: "Resource": "*" Change the policy to specify only the ARNs of the log groups that you want shared, as in the following example: "Resource": [ "SharedLogGroup1ARN", "SharedLogGroup2ARN" ] Allowing people that you share with to see custom widgets When you share a dashboard, by default the custom widgets that are on the dashboard are not visible to the people who you share the dashboard with. This affects both custom widgets that exist now and any that are added to the dashboard after you share it. If you want these people to be able to see custom widgets, you must add permissions to the IAM role for dashboard sharing. To allow the people that you share a dashboard with to see the custom widgets 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of the shared dashboard. 4. Choose Actions, Share dashboard. 5. Under Resources, choose IAM Role. 6. In the IAM console, choose the displayed policy. Allowing people that you share with to see custom widgets 105 Amazon CloudWatch User Guide 7. Choose Edit policy and add the following statement. In the new statement, we recommend that you specify the ARNs of only the Lambda functions that you want shared. See the following example. { "Sid": "Invoke", "Effect": "Allow", "Action": [ "lambda:InvokeFunction" ], "Resource": [ "LambdaFunction1ARN", "LambdaFunction2ARN" ] } 8. Choose Save Changes. If your IAM policy for dashboard sharing already includes that permission with * as the resource, we strongly recommend that you change the policy and specify only the ARNs of the Lambda functions that you want shared. For example, if your Resource section for these permissions was the following: "Resource": "*" Change the policy to specify only the ARNs of the custom widgets that you want shared, as in the following example: "Resource": [ "LambdaFunction1ARN", "LambdaFunction2ARN" ] Using live data in CloudWatch dashboards You can choose whether your metric widgets display live data. Live data is data published within the last minute that has not been fully aggregated. Using live data 106 Amazon CloudWatch User Guide • If live data is turned off, only data points with an aggregation period of at least one minute in the past are shown. For example, when using 5-minute periods, the data point for 12:35 would be aggregated from 12:35 to 12:40, and displayed at 12:41. • If live data is turned on, the most recent data point is shown as soon as any data is published in the corresponding aggregation interval. Each time you refresh the display, the most recent data point may change as new data within that aggregation period is published. If you use a cumulative statistic such as Sum or Sample Count, using live |
acw-ug-045 | acw-ug.pdf | 45 | data points with an aggregation period of at least one minute in the past are shown. For example, when using 5-minute periods, the data point for 12:35 would be aggregated from 12:35 to 12:40, and displayed at 12:41. • If live data is turned on, the most recent data point is shown as soon as any data is published in the corresponding aggregation interval. Each time you refresh the display, the most recent data point may change as new data within that aggregation period is published. If you use a cumulative statistic such as Sum or Sample Count, using live data may result in a dip at the end of your graph. You can choose to enable live data for a whole dashboard, or for individual widgets on the dashboard. Using live data for a CloudWatch dashboard To choose whether to use live data on your entire dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. To permanently turn live data on or off for all widgets on the dashboard, do the following: a. Choose Actions, Settings, Bulk update live data. b. Choose Live Data on or Live Data off, and choose Set. 4. To temporarily override the live data settings of each widget, choose Actions. Then, under Overrides, next to Live data, do one of the following: • Choose On to temporarily turn on live data for all widgets. • Choose Off to temporarily turn off live data for all widgets. • Choose Do not override to preserve each widget's live data setting. Using live data for a CloudWatch dashboard widget To choose whether to use live data on a single widget 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. Select a widget, and choose Actions, Edit. Using live data for a dashboard 107 Amazon CloudWatch User Guide 4. Choose the Graph options tab. 5. Select or clear the check box under Live Data. Viewing an animated CloudWatch dashboard You can view an animated dashboard that replays CloudWatch metric data that was captured over time. This can help you see trends, make presentations, or analyze issues after they occur. Animated widgets in the dashboard include line widgets, stacked area widgets, number widgets, and metrics explorer widgets. Pie graphs, bar charts, text widgets, and logs widgets are displayed in the dashboard but are not animated. To view an animated dashboard 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards. 3. Choose the name of the dashboard. 4. Choose Actions, Replay dashboard. 5. (Optional) By default, when you start the animation, it appears as a sliding window. If you want the animation to appear as a point-by-point animation instead, choose the magnifying glass icon while the animation is paused and reset the zoom. 6. To start the animation, choose the Play button. You can also choose the back and forward buttons to move to other points in time. 7. (Optional) To change the time window for the animation, choose the calendar and select the time period. 8. To change the speed of the animation, choose Auto speed and select the new speed. 9. When you are finished, choose Exit animate. Adding a CloudWatch dashboard to your favorites list In the CloudWatch console, you can add dashboards, alarms, and log groups to a favorites list. You can access the favorites list from the navigation pane. The following procedure describes how to add a dashboard to the favorites list. Viewing an animated dashboard 108 Amazon CloudWatch User Guide To add a dashboard to the favorites list 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards. From the list of dashboards, select the star symbol next to the name of the dashboard that you want to favorite. • (Optional) You also can favorite a dashboard by selecting a dashboard from the list and choosing the star symbol next to the dashboard name. 4. To access the favorites list, choose Favorites and recents in the navigation pane. The menu contains two columns. One contains your favorite dashboards, alarms, and log groups, and the other column contains the dashboards, alarms, and log groups that you recently visited. Tip You can favorite dashboards, as well as alarms and log groups, from the Favorites and recents menu in the CloudWatch console navigation pane. Under the Recently visited column, hover over the dashboard that you want to favorite, and choose the star symbol next to it. Changing the period override setting or refresh interval for the CloudWatch dashboard You can specify how the period setting of graphs added to this dashboard are retained or modified. When an auto period or persisted time range is |
acw-ug-046 | acw-ug.pdf | 46 | groups, and the other column contains the dashboards, alarms, and log groups that you recently visited. Tip You can favorite dashboards, as well as alarms and log groups, from the Favorites and recents menu in the CloudWatch console navigation pane. Under the Recently visited column, hover over the dashboard that you want to favorite, and choose the star symbol next to it. Changing the period override setting or refresh interval for the CloudWatch dashboard You can specify how the period setting of graphs added to this dashboard are retained or modified. When an auto period or persisted time range is applied to a widget, the overall time range of the graph can affect the periods that you have set. • If the time range is one day or less, period settings are not changed. • If the time range is between one day and three days, periods set to below five minutes are changed to 5 minutes. • If the time range is more than three days, periods set to below one hour are changed to one hour. Changing the period override setting or refresh interval 109 Amazon CloudWatch User Guide The following steps explain how to use the console to change the period override options. You can also change them by using the periodOverride field in the JSON structure of the dashboard. For more information, see Dashboard Body Overall Structure. To change the period override options 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. Choose Actions. 3. Under Period override, choose one of the following: • Choose Auto to have the period of the metrics on each graph automatically adapt to the dashboard's time range. • Choose Do not override to ensure that the period setting of each graph is always obeyed. • Choose one of the other options to cause graphs added to the dashboard to always adapt that chosen time as their period setting. The Period override always reverts to Auto when the dashboard is closed or the browser is refreshed. Different settings for Period override can't be saved. You can change how often the data on your CloudWatch dashboard is refreshed. To change the dashboard refresh interval 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Dashboards, and then choose a dashboard. 3. On the Refresh options menu (upper-right corner), choose 10 Seconds, 1 Minute, 2 Minutes, 5 Minutes, or 15 Minutes. Changing the time range or time zone format of a CloudWatch dashboard You can change the time range to display dashboard data over minutes, hours, days, or weeks. You also can change the time zone format to display dashboard data in UTC or local time. Local time is the time zone that's specified in your computer's operating system. Changing the time range or time zone format 110 Amazon CloudWatch Note User Guide If you create a dashboard with graphs that contain 100 or more high-resolution metrics, we recommend that you don't set the time range to longer than 1 hour. For more information, see High-resolution metrics. Note If the time range of a dashboard is shorter than the period used for a widget on the dashboard, the following happens: • The widget 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. New console To change the dashboard time range 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. From the dashboard screen, do one of the following: • • In the upper area of the dashboard, select one of the predefined time ranges. These span from 1 hour to 1 week (1h, 3h, 12h, 1d, or 1w). Alternatively, you can choose one of the following custom time range options: • Choose Custom, and then choose the Relative tab. Choose a time range from 1 minute to 15 months. • Choose Custom, and then choose the Absolute tab. Use the calendar or text fields to specify your time range. Changing the time range or time zone format 111 Amazon CloudWatch Tip User Guide If the aggregation period is set to Auto when you change the time range of a graph, CloudWatch might change the period. To set the period manually, choose the Actions dropdown, and then choose Period override. To change the dashboard time zone format 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper area of the dashboard, choose Custom. |
acw-ug-047 | acw-ug.pdf | 47 | Absolute tab. Use the calendar or text fields to specify your time range. Changing the time range or time zone format 111 Amazon CloudWatch Tip User Guide If the aggregation period is set to Auto when you change the time range of a graph, CloudWatch might change the period. To set the period manually, choose the Actions dropdown, and then choose Period override. To change the dashboard time zone format 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper area of the dashboard, choose Custom. In the upper-right corner of the box that appears, select UTC or Local time from the dropdown. 5. Choose Apply. Old console To change the dashboard time range 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Dashboards, and then choose a dashboard. From the dashboard screen, do one of the following: • • In the upper area of the dashboard, select one of the predefined time ranges. These span from 1 hour to 1 week (1h, 3h, 12h, 1d, 3d, or 1w). Alternatively, you can choose one of the following custom time range options: • Choose the custom dropdown, and then choose the Relative tab. Select one of the predefined ranges, which span from 1 minute to 15 months. • Choose the custom dropdown, and then choose the Absolute tab. Use the calendar or text fields to specify your time range. Changing the time range or time zone format 112 Amazon CloudWatch Tip User Guide If the aggregation period is set to Auto when you change the time range of a graph, CloudWatch might change the period. To set the period manually, choose the Actions dropdown, and then choose Period override. To change the dashboard time zone format 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Dashboards, and then choose a dashboard. In the upper-right corner of the dashboard screen, choose the Custom dropdown. In the upper-right corner of the box that appears, select UTC or Local timezone from the dropdown. Changing the time range or time zone format 113 Amazon CloudWatch User Guide Metrics in Amazon CloudWatch Metrics are data about the performance of your systems. By default, many services provide free metrics for resources (such as Amazon EC2 instances, Amazon EBS volumes, and Amazon RDS DB instances). You can also enable detailed monitoring for some resources, such as your Amazon EC2 instances, or publish your own application metrics. Amazon CloudWatch can load all the metrics in your account (both AWS resource metrics and application metrics that you provide) for search, graphing, and alarms. Metric data is kept for 15 months, enabling you to view both up-to-the-minute data and historical data. To graph metrics in the console, you can use CloudWatch Metrics Insights, a high-performance SQL query engine that you can use to identify trends and patterns within all your metrics in real time. Metrics concepts The following terminology and concepts are central to your understanding and use of Amazon CloudWatch: • Namespaces • Metrics • Dimensions • Resolution • Statistics • Percentiles • Alarms For information about the service quotas for CloudWatch metrics, alarms, API requests, and alarm email notifications, see CloudWatch service quotas. Namespaces A namespace is a container for CloudWatch metrics. Metrics in different namespaces are isolated from each other, so that metrics from different applications are not mistakenly aggregated into the same statistics. Concepts 114 Amazon CloudWatch User Guide There is no default namespace. You must specify a namespace for each data point you publish to CloudWatch. You can specify a namespace name when you create a metric. These names must contain valid ASCII characters, and be 255 or fewer characters. Possible characters are: alphanumeric characters (0-9A-Za-z), period (.), hyphen (-), underscore (_), forward slash (/), hash (#), colon (:), and the space character. A namespace must contain at least one non-whitespace character. The AWS namespaces typically use the following naming convention: AWS/service. For example, Amazon EC2 uses the AWS/EC2 namespace. For the list of AWS namespaces, see AWS services that publish CloudWatch metrics. Metrics Metrics are the fundamental concept in CloudWatch. A metric represents a time-ordered set of data points that are published to CloudWatch. Think of a metric as a variable to monitor, and the data points as representing the values of that variable over time. For example, the CPU usage of a particular EC2 instance is one metric provided by Amazon EC2. The data points themselves can come from any application or business activity from which you collect data. By default, many AWS services provide metrics at no charge for resources (such as Amazon EC2 instances, Amazon EBS volumes, and Amazon RDS DB instances). For a charge, you can |
acw-ug-048 | acw-ug.pdf | 48 | A metric represents a time-ordered set of data points that are published to CloudWatch. Think of a metric as a variable to monitor, and the data points as representing the values of that variable over time. For example, the CPU usage of a particular EC2 instance is one metric provided by Amazon EC2. The data points themselves can come from any application or business activity from which you collect data. By default, many AWS services provide metrics at no charge for resources (such as Amazon EC2 instances, Amazon EBS volumes, and Amazon RDS DB instances). For a charge, you can also enable detailed monitoring for some resources, such as your Amazon EC2 instances, or publish your own application metrics. For custom metrics, you can add the data points in any order, and at any rate you choose. You can retrieve statistics about those data points as an ordered set of time-series data. Metrics exist only in the Region in which they are created. Metrics cannot be deleted, but they automatically expire after 15 months if no new data is published to them. Data points older than 15 months expire on a rolling basis; as new data points come in, data older than 15 months is dropped. Metrics are uniquely defined by a name, a namespace, and zero or more dimensions. Each data point in a metric has a time stamp, and (optionally) a unit of measure. You can retrieve statistics from CloudWatch for any metric. For more information, see View available metrics and Publish custom metrics. Metrics 115 Amazon CloudWatch Time stamps User Guide Each metric data point must be associated with a time stamp. The time stamp can be up to two weeks in the past and up to two hours into the future. If you do not provide a time stamp, CloudWatch creates a time stamp for you based on the time the data point was received. Time stamps are dateTime objects, with the complete date plus hours, minutes, and seconds (for example, 2016-10-31T23:59:59Z). For more information, see dateTime. Although it is not required, we recommend that you use Coordinated Universal Time (UTC). When you retrieve statistics from CloudWatch, all times are in UTC. CloudWatch alarms check metrics based on the current time in UTC. Custom metrics sent to CloudWatch with time stamps other than the current UTC time can cause alarms to display the Insufficient Data state or result in delayed alarms. Metrics retention CloudWatch retains metric data as follows: • Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution custom metrics. • Data points with a period of 60 seconds (1 minute) are available for 15 days • Data points with a period of 300 seconds (5 minutes) are available for 63 days • Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months) Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days this data is still available, but is aggregated and is retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour. 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. Metrics 116 Amazon CloudWatch Dimensions User Guide A dimension is a name/value pair that is part of the identity of a metric. You can assign up to 30 dimensions to a metric. Every metric has specific characteristics that describe it, and you can think of dimensions as categories for those characteristics. Dimensions help you design a structure for your statistics plan. Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. AWS services that send data to CloudWatch attach dimensions to each metric. You can use dimensions to filter the results that CloudWatch returns. For example, you can get statistics for a specific EC2 instance by specifying the InstanceId dimension when you search for metrics. For metrics produced by certain AWS services, such as Amazon EC2, CloudWatch can aggregate data across dimensions. For example, if you search for |
acw-ug-049 | acw-ug.pdf | 49 | plan. Because dimensions are part of the unique identifier for a metric, whenever you add a unique name/value pair to one of your metrics, you are creating a new variation of that metric. AWS services that send data to CloudWatch attach dimensions to each metric. You can use dimensions to filter the results that CloudWatch returns. For example, you can get statistics for a specific EC2 instance by specifying the InstanceId dimension when you search for metrics. For metrics produced by certain AWS services, such as Amazon EC2, CloudWatch can aggregate data across dimensions. For example, if you search for metrics in the AWS/EC2 namespace but do not specify any dimensions, CloudWatch aggregates all data for the specified metric to create the statistic that you requested. CloudWatch does not aggregate across dimensions for your custom metrics. Dimension combinations CloudWatch treats each unique combination of dimensions as a separate metric, even if the metrics have the same metric name. You can only retrieve statistics using combinations of dimensions that you specifically published. When you retrieve statistics, specify the same values for the namespace, metric name, and dimension parameters that were used when the metrics were created. You can also specify the start and end times for CloudWatch to use for aggregation. For example, suppose that you publish four distinct metrics named ServerStats in the DataCenterMetric namespace with the following properties: Dimensions: Server=Prod, Domain=Frankfurt, Unit: Count, Timestamp: 2016-10-31T12:30:00Z, Value: 105 Dimensions: Server=Beta, Domain=Frankfurt, Unit: Count, Timestamp: 2016-10-31T12:31:00Z, Value: 115 Dimensions: Server=Prod, Domain=Rio, Unit: Count, Timestamp: 2016-10-31T12:32:00Z, Value: 95 Dimensions: Server=Beta, Domain=Rio, Unit: Count, Timestamp: 2016-10-31T12:33:00Z, Value: 97 Dimensions 117 Amazon CloudWatch User Guide If you publish only those four metrics, you can retrieve statistics for these combinations of dimensions: • Server=Prod,Domain=Frankfurt • Server=Prod,Domain=Rio • Server=Beta,Domain=Frankfurt • Server=Beta,Domain=Rio You can't retrieve statistics for the following dimensions or if you specify no dimensions. (The exception is by using the metric math SEARCH function, which can retrieve statistics for multiple metrics. For more information, see Use search expressions in graphs.) • Server=Prod • Server=Beta • Domain=Frankfurt • Domain=Rio Resolution Each metric is one of the following: • 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. Resolution 118 Amazon CloudWatch User Guide 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. Statistics Statistics are metric data aggregations over specified periods of time. CloudWatch provides statistics based on the metric data points provided by your custom data or provided by other AWS services to CloudWatch. Aggregations are made using the namespace, metric name, dimensions, and the data point unit of measure, within the time period you specify. For detailed definitions of the statistics supported by CloudWatch, see CloudWatch statistics definitions. Units Each statistic has a unit of measure. Example units include Bytes, Seconds, Count, and Percent. For the complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference. You can specify a unit when you create a custom metric. If you do not specify a unit, CloudWatch uses None as the unit. Units help provide conceptual meaning to your data. Though CloudWatch attaches no significance to a unit internally, other applications can derive semantic information based on the unit. Metric data points that specify a unit of measure are aggregated separately. When you get statistics without specifying a unit, CloudWatch aggregates all data points of the same unit together. If you have two otherwise identical metrics with different units, two separate data streams are returned, one for each unit. Periods A period is the length of time associated with a specific Amazon CloudWatch statistic. Each statistic represents an aggregation of the metrics data collected for a specified period of time. Periods are defined in numbers of seconds, and valid values for period |
acw-ug-050 | acw-ug.pdf | 50 | derive semantic information based on the unit. Metric data points that specify a unit of measure are aggregated separately. When you get statistics without specifying a unit, CloudWatch aggregates all data points of the same unit together. If you have two otherwise identical metrics with different units, two separate data streams are returned, one for each unit. Periods A period is the length of time associated with a specific Amazon CloudWatch statistic. Each statistic represents an aggregation of the metrics data collected for a specified period of time. Periods are defined in numbers of seconds, and valid values for period are 1, 5, 10, 30, or any multiple of 60. For example, to specify a period of six minutes, use 360 as the period value. You can adjust how the data is aggregated by varying the length of the period. The default value of a period is 60 seconds. A period can be as short as one second, and must be a multiple of 60 if it is greater than the default value of 60 seconds. Statistics 119 Amazon CloudWatch User Guide Only custom metrics that you define with a storage resolution of 1 second support sub-minute periods. Even though the option to set a period below 60 is always available in the console, you should select a period that aligns to how the metric is stored. For more information about metrics that support sub-minute periods, see High-resolution metrics. When you retrieve statistics, you can specify a period, start time, and end time. These parameters determine the overall length of time associated with the statistics. The default values for the start time and end time get you the last hour's worth of statistics. The values that you specify for the start time and end time determine how many periods CloudWatch returns. For example, retrieving statistics using the default values for the period, start time, and end time returns an aggregated set of statistics for each minute of the previous hour. If you prefer statistics aggregated in ten-minute blocks, specify a period of 600. For statistics aggregated over the entire hour, specify a period of 3600. When statistics are aggregated over a period of time, they are stamped with the time corresponding to the beginning of the period. For example, data aggregated from 7:00pm to 8:00pm is stamped as 7:00pm. Additionally, data aggregated between 7:00pm and 8:00pm begins to be visible at 7:00pm, then the values of that aggregated data may change as CloudWatch collects more samples during the period. Periods are also important for CloudWatch alarms. When you create an alarm to monitor a specific metric, you are asking CloudWatch to compare that metric to the threshold value that you specified. You have extensive control over how CloudWatch makes that comparison. Not only can you specify the period over which the comparison is made, but you can also specify how many evaluation periods are used to arrive at a conclusion. For example, if you specify three evaluation periods, CloudWatch compares a window of three data points. CloudWatch only notifies you if the oldest data point is breaching and the others are breaching or missing. Aggregation Amazon CloudWatch aggregates statistics according to the period length that you specify when retrieving statistics. You can publish as many data points as you want with the same or similar time stamps. CloudWatch aggregates them according to the specified period length. CloudWatch does not automatically aggregate data across Regions, but you can use metric math to aggregate metrics from different Regions. You can publish data points for a metric that share not only the same time stamp, but also the same namespace and dimensions. CloudWatch returns aggregated statistics for those data points. You can also publish multiple data points for the same or different metrics, with any time stamp. Aggregation 120 Amazon CloudWatch User Guide For large datasets, you can insert a pre-aggregated dataset called a statistic set. With statistic sets, you give CloudWatch the Min, Max, Sum, and SampleCount for a number of data points. This is commonly used when you need to collect data many times in a minute. For example, suppose you have a metric for the request latency of a web page. It doesn't make sense to publish data with every web page hit. We suggest that you collect the latency of all hits to that web page, aggregate them once a minute, and send that statistic set to CloudWatch. Amazon CloudWatch doesn't differentiate the source of a metric. If you publish a metric with the same namespace and dimensions from different sources, CloudWatch treats this as a single metric. This can be useful for service metrics in a distributed, scaled system. For example, all the hosts in a web server application could publish identical metrics representing the latency of requests |
acw-ug-051 | acw-ug.pdf | 51 | page. It doesn't make sense to publish data with every web page hit. We suggest that you collect the latency of all hits to that web page, aggregate them once a minute, and send that statistic set to CloudWatch. Amazon CloudWatch doesn't differentiate the source of a metric. If you publish a metric with the same namespace and dimensions from different sources, CloudWatch treats this as a single metric. This can be useful for service metrics in a distributed, scaled system. For example, all the hosts in a web server application could publish identical metrics representing the latency of requests they are processing. CloudWatch treats these as a single metric, allowing you to get the statistics for minimum, maximum, average, and sum of all requests across your application. Percentiles A percentile indicates the relative standing of a value in a dataset. For example, the 95th percentile means that 95 percent of the data 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. Percentiles are often used to isolate anomalies. In a normal distribution, 95 percent of the data is within two standard deviations from the mean and 99.7 percent of the data is within three standard deviations from the mean. Any data that falls outside three standard deviations is often considered to be an anomaly because it differs so greatly from the average value. For example, suppose that you are monitoring the CPU utilization of your EC2 instances to ensure that your customers have a good experience. If you monitor the average, this can hide anomalies. If you monitor the maximum, a single anomaly can skew the results. Using percentiles, you can monitor the 95th percentile of CPU utilization to check for instances with an unusually heavy load. Some CloudWatch metrics support percentiles as a statistic. For these metrics, you can monitor your system and applications using percentiles as you would when using the other CloudWatch statistics (Average, Minimum, Maximum, and Sum). For example, when you create an alarm, you can use percentiles as the statistical function. You can specify the percentile with up to ten decimal places (for example, p95.0123456789). Percentile statistics are available for custom metrics as long as you publish the raw, unsummarized data points for your custom metric. Percentile statistics are not available for metrics when any of the metric values are negative numbers. Percentiles 121 Amazon CloudWatch User Guide CloudWatch needs raw data points to calculate percentiles. If you publish data using a statistic set instead, you can only retrieve percentile statistics for this data 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 percentile statistics. • API Gateway • Application Load Balancer • Amazon EC2 • Elastic Load Balancing • Kinesis • Lambda • Amazon RDS CloudWatch also supports trimmed mean and other performance statistics, which can have a similar use as percentiles. For more information, see CloudWatch statistics definitions. Alarms You can use an alarm to automatically initiate actions on your behalf. An alarm watches a single metric over a specified time period, and performs one or more specified actions, based on the value of the metric relative to a threshold over time. The action is a notification sent to an Amazon SNS topic or an Auto Scaling policy. You can also add alarms to dashboards. Alarms invoke actions for sustained state changes only. CloudWatch alarms do not invoke actions simply because they are in a particular state. The state must have changed and been maintained for a specified number of periods. When creating an alarm, select an alarm monitoring period that is greater than or equal to the metrics resolution. For example, basic monitoring for Amazon EC2 provides metrics for your instances every 5 minutes. When setting an alarm on a basic monitoring metric, select a period of at least 300 seconds (5 minutes). Detailed monitoring for Amazon EC2 provides metrics for your instances with a resolution of 1 minute. When setting an alarm on a detailed monitoring metric, select a period of at least 60 seconds (1 minute). Alarms 122 Amazon CloudWatch User Guide 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. For more information about high- resolution metrics, see Publish custom metrics. For more information, see Using Amazon |
acw-ug-052 | acw-ug.pdf | 52 | metrics for your instances with a resolution of 1 minute. When setting an alarm on a detailed monitoring metric, select a period of at least 60 seconds (1 minute). Alarms 122 Amazon CloudWatch User Guide 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. For more information about high- resolution metrics, see Publish custom metrics. For more information, see Using Amazon CloudWatch alarms and Create an alarm from a metric on a graph. Basic monitoring and detailed monitoring in CloudWatch CloudWatch provides two categories of monitoring: basic monitoring and detailed monitoring. Many AWS services offer basic monitoring by publishing a default set of metrics to CloudWatch with no charge to customers. By default, when you start using one of these AWS services, basic monitoring is automatically enabled. For a list of services that offer basic monitoring, see AWS services that publish CloudWatch metrics. Detailed monitoring is offered by only some services. It also incurs charges. To use it for an AWS service, you must choose to activate it. For more information about pricing, see Amazon CloudWatch pricing. Detailed monitoring options differ based on the services that offer it. For example, Amazon EC2 detailed monitoring provides more frequent metrics, published at one-minute intervals, instead of the five-minute intervals used in Amazon EC2 basic monitoring. Detailed monitoring for Amazon S3 and Amazon Managed Streaming for Apache Kafka means more fine-grained metrics. In different AWS services, detailed monitoring also has different names. For example, in Amazon EC2 it is called detailed monitoring, in AWS Elastic Beanstalk it is called enhanced monitoring, and in Amazon S3 it is called request metrics. Using detailed monitoring for Amazon EC2 helps you better manage your Amazon EC2 resources, so that you can find trends and take action faster. For Amazon S3 request metrics are available at one-minute intervals to help you quickly identify and act on operational issues. On Amazon MSK, when you enable the PER_BROKER, PER_TOPIC_PER_BROKER, or PER_TOPIC_PER_PARTITION level monitoring, you get additional metrics that provide more visibility. The following table lists the services that offer detailed monitoring. It also includes links to the documentation for those services that explain more about the detailed monitoring and provide instructions for how to activate it. Basic and detailed monitoring 123 Amazon CloudWatch User Guide Service Documentation Amazon API Gateway AWS AppSync Amazon CloudFront Amazon EC2 Elastic Beanstalk Dimensions for API Gateway metrics CloudWatch metrics Viewing additional CloudFront distribution metrics Manage detailed monitoring for your EC2 instances Enhanced health reporting and monitoring Amazon Kinesis Data Streams Enhanced Shard- level Metrics AWS Lambda Amazon MSK Amazon S3 Event source mapping metrics Amazon MSK Metrics for Monitoring with CloudWatch Amazon S3 request metrics in CloudWatch Basic and detailed monitoring 124 Amazon CloudWatch User Guide Service Documentation Amazon SES Collect CloudWatc h detailed monitoring metrics using Amazon SES event publishin g. Additionally, CloudWatch offers out-of-the-box monitoring solutions with more detailed metrics and pre-created dashboards for some AWS services, as shown in the following table. Service Feature documentation Lambda Lambda Insights Amazon ECS Amazon EKS Amazon RDS Amazon Aurora Container Insights for Amazon ECS Container Insights for Amazon EKS and Kubernetes CloudWatc h Database Insights CloudWatc h Database Insights Basic and detailed monitoring 125 Amazon CloudWatch User Guide Query your CloudWatch metrics with CloudWatch Metrics Insights CloudWatch Metrics Insights is a powerful high-performance SQL query engine that you can use to query your metrics at scale. You can identify trends and patterns within all of your CloudWatch metrics in real time. You can also set alarms on any Metrics Insights queries that return a single time series. This can be especially useful to create alarms that watch aggregated metrics across a fleet of your infrastructure or applications. Create the alarm once, and it dynamically adjusts as resources are added to or removed from the fleet. You can perform a CloudWatch Metrics Insights query in the console with the CloudWatch Metrics Insights query editor. You can also perform a CloudWatch Metrics Insights query with the AWS CLI or an AWS SDK by running GetMetricData or PutDashboard. There's no charge for queries that you run with the CloudWatch Metrics Insights query editor. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. With the CloudWatch Metrics Insights query editor, you can choose from a variety of prebuilt sample queries and also create your own queries. As you create your queries, you can use a builder view to browse your existing metrics and dimensions. Alternatively, use an editor view to manually write queries. You can also use natural language to create CloudWatch Metrics Insights queries. To do |
acw-ug-053 | acw-ug.pdf | 53 | AWS CLI or an AWS SDK by running GetMetricData or PutDashboard. There's no charge for queries that you run with the CloudWatch Metrics Insights query editor. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. With the CloudWatch Metrics Insights query editor, you can choose from a variety of prebuilt sample queries and also create your own queries. As you create your queries, you can use a builder view to browse your existing metrics and dimensions. Alternatively, use an editor view to manually write queries. You can also use natural language to create CloudWatch Metrics Insights queries. To do so, ask questions about or describe the data you're looking for. This AI-assisted capability generates a query based on your prompt and provides a line-by-line explanation of how the query works. For more information, see Use natural language to generate and update CloudWatch Metrics Insights queries. With Metrics Insights, you can run queries at scale. With the GROUP BY clause, you can group your metrics in real time into separate time series per specific dimension value. Because Metrics Insights queries include an ORDER BY ability, you can use Metrics Insights to make "Top N" type queries. For example, "Top N" type queries can scan millions of metrics in your account and return the 10 instances that consume the most CPU. This can help you pinpoint and remedy latency issues in your applications. Topics • Building your queries in CloudWatch Metrics Insights Query metrics with CloudWatch Metrics Insights 126 Amazon CloudWatch User Guide • Query components and syntax in CloudWatch Metrics Insights • Alarms on CloudWatch Metrics Insights queries in CloudWatch • Use Metrics Insights queries with metric math • Use natural language to generate and update CloudWatch Metrics Insights queries • SQL inference • Metrics Insights sample queries • Metrics Insights limits • Metrics Insights glossary • Troubleshooting Metrics Insights Building your queries in CloudWatch Metrics Insights You can run a CloudWatch Metrics Insights query using the CloudWatch console, the AWS CLI, or the AWS SDKs. Queries run in the console are free of charge. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing. For more information about using the AWS SDKs to perform a Metrics Insights query, see GetMetricData. To run a query using the CloudWatch console, follow these steps: To query your metrics using Metrics Insights 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Metrics, All metrics. (Optional) To run a pre-built sample query, choose Add query and select the query to run. If you are satisfied with this query, you can skip the rest of this procedure. Or, you can choose Editor to edit the sample query and then choose Run to run the modified query. To create your own query, choose Multi source query. You can then use the Builder view, the Editor view, and also use a combination of both. You can switch between the two views anytime and see your work in progress in both views. In the Builder view, you can browse and select the metric namespace, metric name, filter, group, and order options. For each of these options, the query builder offers you a list of possible selections from your environment to choose from. Building queries 127 Amazon CloudWatch User Guide In the Editor view, you can start writing your query. As you type, the editor offers suggestions based on the characters that you have typed so far. 5. When you are satisfied with your query, choose Run. 6. 7. (Optional) Another way to edit a query that you have graphed is to choose the Graphed metrics tab and choose the edit icon next to the query formula in the Details column. (Optional) To remove a query from the graph, choose Graphed metrics and choose the X icon at the right side of the row that displays your query. Query components and syntax in CloudWatch Metrics Insights CloudWatch Metrics Insights syntax is as follows. SELECT FUNCTION(metricName) FROM namespace | SCHEMA(...) [ WHERE labelKey OPERATOR labelValue [AND ... ] ] [ GROUP BY labelKey [ , ... ] ] [ ORDER BY FUNCTION() [ DESC | ASC ] ] [ LIMIT number ] The possible clauses in a Metrics Insights query are as follows. None of the keywords are case sensitive, but the identifiers such as the names of metrics, namespaces, and dimensions are case sensitive. SELECT Required. Specifies the function to use to aggregate observations in each time bucket (determined by the provided period). Also specifies the name of the metric to query. The valid values for FUNCTION are AVG, COUNT, MAX, MIN, and SUM. • AVG calculates the average of the observations matched by the query. • COUNT returns the count of the observations matched by the query. • MAX returns the maximum |
acw-ug-054 | acw-ug.pdf | 54 | clauses in a Metrics Insights query are as follows. None of the keywords are case sensitive, but the identifiers such as the names of metrics, namespaces, and dimensions are case sensitive. SELECT Required. Specifies the function to use to aggregate observations in each time bucket (determined by the provided period). Also specifies the name of the metric to query. The valid values for FUNCTION are AVG, COUNT, MAX, MIN, and SUM. • AVG calculates the average of the observations matched by the query. • COUNT returns the count of the observations matched by the query. • MAX returns the maximum value of the observations matched by the query. • MIN returns the minimum value of the observations matched by the query. • SUM calculates the sum of the observations matched by the query. Query components and syntax 128 Amazon CloudWatch FROM User Guide Required. Specifies the source of the metric. You can specify either the metric namespace that contains the metric that is to be queried, or a SCHEMA table function. Examples of metric namespaces include "AWS/EC2", "AWS/Lambda", and metric namespaces that you have created for your custom metrics. Metric namespaces that include / or any other character that is not a letter, number, or underscore must be surrounded by double quotation marks. For more information, see What needs quotation marks or escape characters?. SCHEMA An optional table function that can be used within a FROM clause. Use SCHEMA to scope down the query results to only the metrics that exactly match a list of dimensions, or to metrics that have no dimensions. If you use a SCHEMA clause, it must contain at least one argument, and this first argument must be the metric namespace being queried. If you specify SCHEMA with only this namespace argument, the results are scoped down to only metrics that do not have any dimensions. If you specify SCHEMA with additional arguments, the additional arguments after the namespace argument must be label keys. Label keys must be dimension names. If you specify one or more of these label keys, the results are scoped down to only those metrics that have that exact set of dimensions. The order of these label keys does not matter. For example: • SELECT AVG(CPUUtilization) FROM "AWS/EC2" matches all CPUUtilization metrics in the AWS/EC2 namespace, no matter their dimensions, and returns a single aggregated time series. • SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2") matches only the CPUUtilization metrics in the AWS/EC2 namespace that do not have any dimensions defined. • SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) matches only the CPUUtilization metrics that were reported to CloudWatch with exactly one dimension, InstanceId. • SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) matches only the RequestCount metrics that were reported to Query components and syntax 129 Amazon CloudWatch User Guide CloudWatch from AWS/ApplicationELB with exactly two dimensions, LoadBalancer and AvailabilityZone. WHERE Optional. Filters the results to only those metrics that match your specified expression using specific label values for one or more label keys. For example, WHERE InstanceType = 'c3.4xlarge' filters the results to only c3.4xlarge instance types, and WHERE InstanceType != 'c3.4xlarge' filters the results to all instance types except c3.4xlarge. When you run a query in a monitoring account, you can use WHERE AWS.AccountId to limit results to only the account that you specify. For example, WHERE AWS.AccountId=444455556666 queries metrics from only account 444455556666. To limit your query to only metrics in the monitoring account itself, use WHERE AWS.AccountId=CURRENT_ACCOUNT_ID(). Label values must always be enclosed with single quotation marks. Supported operators The WHERE clause supports the following operators: • = Label value must match the specified string. • != Label value must not match the specified string. • AND Both conditions that are specified must be true to match. You can use multiple AND keywords to specify two or more conditions. GROUP BY Optional. Groups the query results into multiple time series, each one corresponding to a different value for the specified label key or keys. For example, using GROUP BY InstanceId returns a different time series for each value of InstanceId. Using GROUP BY ServiceName, Operation creates a different time series for each possible combination of the values of ServiceName and Operation. With a GROUP BY clause, by default the results are ordered in alphabetical ascending order, using the sequence of labels specified in the GROUP BY clause. To change the order of the results, add an ORDER BY clause to your query. When you run a query in a monitoring account, you can use GROUP BY AWS.AccountId to group the results based on the accounts they are from. Query components and syntax 130 Amazon CloudWatch Note User Guide If some of the matching metrics don't include a specific label key specified in the GROUP BY clause, a null group named Other is returned. For |
acw-ug-055 | acw-ug.pdf | 55 | BY clause, by default the results are ordered in alphabetical ascending order, using the sequence of labels specified in the GROUP BY clause. To change the order of the results, add an ORDER BY clause to your query. When you run a query in a monitoring account, you can use GROUP BY AWS.AccountId to group the results based on the accounts they are from. Query components and syntax 130 Amazon CloudWatch Note User Guide If some of the matching metrics don't include a specific label key specified in the GROUP BY clause, a null group named Other is returned. For example, if you specify GROUP BY ServiceName, Operation and some of the returned metrics don't include ServiceName as a dimension, then those metrics are displayed as having Other as the value for ServiceName. ORDER BY Optional. Specifies the order to use for the returned time series, if the query returns more than one time series. The order is based on the values found by the FUNCTION that you specify in the ORDER BY clause. The FUNCTION is used to calculate a single scalar value from each returned time series, and that value is used to determine the order. You also specify whether to use ascending ASC or descending DESC order. If you omit this, the default is ascending ASC. For example, adding an ORDER BY MAX() DESC clause orders the results by the maximum data point observed within the time range, in descending order: meaning that the time series that has the highest maximum data point is returned first. The valid functions to use within an ORDER BY clause are AVG(), COUNT(), MAX(), MIN(), and SUM(). If you use an ORDER BY clause with a LIMIT clause, the resulting query is a "Top N" query. ORDER BY is also useful for queries that might return a large number of metrics, because each query can return no more than 500 time series. If a query matches more than 500 time series, and you use an ORDER BY clause, the time series are sorted and then the 500 time series that come first in the sort order are the ones that are returned. LIMIT Optional. Limits the number of time series returned by the query to the value that you specify. The maximum value that you can specify is 500, and a query that does not specify a LIMIT can also return no more than 500 time series. Using a LIMIT clause with an ORDER BY clause gives you a "Top N" query. Query components and syntax 131 Amazon CloudWatch User Guide What needs quotation marks or escape characters? In a query, label values must always be surrounded with single quotation marks. For example, SELECT MAX(CPUUtilization) FROM "AWS/EC2" WHERE AutoScalingGroupName = 'my- production-fleet'. Metric namespaces, metric names, and label keys that contain characters other than letters, numbers, and underscore (_) must be surrounded by double quote marks. For example, SELECT MAX("My.Metric"). If one of these contains a double quotation mark or single quotation mark itself (such as Bytes"Input"), you must escape each quotation mark with a backslash, as in SELECT AVG("Bytes \"Input\""). If a metric namespace, metric name, or label key, contains a word that is a reserved keyword in Metrics Insights, these must also be enclosed in double quotation marks. For example, if you have a metric named LIMIT, you would use SELECT AVG("LIMIT"). It is also valid to enclose any namespace, metric name, or label in double quotation marks even if it does not include a reserved keyword. For a complete list of reserved keywords, see Reserved keywords. Build a rich query step by step This section illustrates building a full example that uses all possible clauses, step by step. We start with the following query, which aggregates all of the Application Load Balancer RequestCount metrics that are collected with both the dimensions LoadBalancer and AvailabilityZone. SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) Now, if we want to see metrics only from a specific load balancer, we can add a WHERE clause to limit the metrics returned to only those metrics where the value of the LoadBalancer dimension is app/load-balancer-1. SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) WHERE LoadBalancer = 'app/load-balancer-1' Query components and syntax 132 Amazon CloudWatch User Guide The preceding query aggregates the RequestCount metrics from all Availability Zones for this load balancer into one time series. If we want to see different time series for each Availability Zone, we can add a GROUP BY clause. SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) WHERE LoadBalancer = 'app/load-balancer-1' GROUP BY AvailabilityZone Next, we might want to order these results to see the highest values first. The following ORDER BY clause orders the time series in descending order, by the maximum value reported by each time series during the query time range: SELECT |
acw-ug-056 | acw-ug.pdf | 56 | components and syntax 132 Amazon CloudWatch User Guide The preceding query aggregates the RequestCount metrics from all Availability Zones for this load balancer into one time series. If we want to see different time series for each Availability Zone, we can add a GROUP BY clause. SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) WHERE LoadBalancer = 'app/load-balancer-1' GROUP BY AvailabilityZone Next, we might want to order these results to see the highest values first. The following ORDER BY clause orders the time series in descending order, by the maximum value reported by each time series during the query time range: SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) WHERE LoadBalancer = 'app/load-balancer-1' GROUP BY AvailabilityZone ORDER BY MAX() DESC Finally, if we are primarily interested in a "Top N" type of query, we can use a LIMIT clause. This final example limits the results to only the time series with the five highest MAX values. SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer, AvailabilityZone) WHERE LoadBalancer = 'app/load-balancer-1' GROUP BY AvailabilityZone ORDER BY MAX() DESC LIMIT 5 Cross-account query examples These examples are valid when run in an account set up as a monitoring account in CloudWatch cross-account observability. The following example searches all Amazon EC2 instances in the source account 123456789012 and returns the average. SELECT AVG(CpuUtilization) FROM "AWS/EC2" WHERE AWS.AccountId ='123456789012' Query components and syntax 133 Amazon CloudWatch User Guide The following example queries the CPUUtilization metric in AWS/EC2 in all the linked source accounts, and groups the results by account ID and instance type. SELECT AVG(CpuUtilization) FROM "AWS/EC2" GROUP BY AWS.AccountId, InstanceType The following example queries the CPUUtilization in the monitoring account itself. SELECT AVG(CpuUtilization) FROM "AWS/EC2" WHERE AWS.AccountId = CURRENT_ACCOUNT_ID() Reserved keywords The following are reserved keywords in CloudWatch Metrics Insights. If any of these words are in a namespace, metric name, or label key in a query, you must enclose them in double quote marks. Reserved keywords are not case sensitive. "ABORT" "ABORTSESSION" "ABS" "ABSOLUTE" "ACCESS" "ACCESSIBLE" "ACCESS_LOCK" "ACCOUNT" "ACOS" "ACOSH" "ACTION" "ADD" "ADD_MONTHS" "ADMIN" "AFTER" "AGGREGATE" "ALIAS" "ALL" "ALLOCATE" "ALLOW" "ALTER" "ALTERAND" "AMP" "ANALYSE" "ANALYZE" "AND" "ANSIDATE" "ANY" "ARE" "ARRAY", "ARRAY_AGG" "ARRAY_EXISTS" "ARRAY_MAX_CARDINALITY" "AS" "ASC" "ASENSITIVE" "ASIN" "ASINH" "ASSERTION" "ASSOCIATE" "ASUTIME" "ASYMMETRIC" "AT", "ATAN" "ATAN2" "ATANH" "ATOMIC" "AUDIT" "AUTHORIZATION" "AUX" "AUXILIARY" "AVE" "AVERAGE" "AVG" "BACKUP" "BEFORE" "BEGIN" "BEGIN_FRAME" "BEGIN_PARTITION", "BETWEEN" "BIGINT" "BINARY" "BIT" "BLOB" "BOOLEAN" "BOTH" "BREADTH" "BREAK" "BROWSE" "BT" "BUFFERPOOL" "BULK" "BUT" "BY" "BYTE" "BYTEINT" "BYTES" "CALL", "CALLED" "CAPTURE" "CARDINALITY" "CASCADE" "CASCADED" "CASE" "CASESPECIFIC" "CASE_N" "CAST" "CATALOG" "CCSID" "CD" "CEIL" "CEILING" "CHANGE" "CHAR", "CHAR2HEXINT" "CHARACTER" "CHARACTERS" "CHARACTER_LENGTH" "CHARS" "CHAR_LENGTH" "CHECK" "CHECKPOINT" "CLASS" "CLASSIFIER" "CLOB" "CLONE" "CLOSE" "CLUSTER", "CLUSTERED" "CM" "COALESCE" "COLLATE" "COLLATION" "COLLECT" "COLLECTION" "COLLID" "COLUMN" "COLUMN_VALUE" "COMMENT" "COMMIT" "COMPLETION" "COMPRESS" "COMPUTE", "CONCAT" "CONCURRENTLY" "CONDITION" "CONNECT" "CONNECTION" "CONSTRAINT" "CONSTRAINTS" "CONSTRUCTOR" "CONTAINS" "CONTAINSTABLE" "CONTENT" "CONTINUE" "CONVERT", "CONVERT_TABLE_HEADER" "COPY" "CORR" "CORRESPONDING" "COS" "COSH" "COUNT" "COVAR_POP" "COVAR_SAMP" "CREATE" "CROSS" "CS" "CSUM" "CT" "CUBE" "CUME_DIST", "CURRENT" "CURRENT_CATALOG" "CURRENT_DATE" "CURRENT_DEFAULT_TRANSFORM_GROUP" "CURRENT_LC_CTYPE" "CURRENT_PATH" "CURRENT_ROLE" "CURRENT_ROW" "CURRENT_SCHEMA", Query components and syntax 134 Amazon CloudWatch User Guide "CURRENT_SERVER" "CURRENT_TIME" "CURRENT_TIMESTAMP" "CURRENT_TIMEZONE" "CURRENT_TRANSFORM_GROUP_FOR_TYPE" "CURRENT_USER" "CURRVAL" "CURSOR" "CV" "CYCLE" "DATA", "DATABASE" "DATABASES" "DATABLOCKSIZE" "DATE" "DATEFORM" "DAY" "DAYS" "DAY_HOUR" "DAY_MICROSECOND" "DAY_MINUTE" "DAY_SECOND" "DBCC" "DBINFO" "DEALLOCATE" "DEC", "DECFLOAT" "DECIMAL" "DECLARE" "DEFAULT" "DEFERRABLE" "DEFERRED" "DEFINE" "DEGREES" "DEL" "DELAYED" "DELETE" "DENSE_RANK" "DENY" "DEPTH" "DEREF" "DESC" "DESCRIBE", "DESCRIPTOR" "DESTROY" "DESTRUCTOR" "DETERMINISTIC" "DIAGNOSTIC" "DIAGNOSTICS" "DICTIONARY" "DISABLE" "DISABLED" "DISALLOW" "DISCONNECT" "DISK" "DISTINCT", "DISTINCTROW" "DISTRIBUTED" "DIV" "DO" "DOCUMENT" "DOMAIN" "DOUBLE" "DROP" "DSSIZE" "DUAL" "DUMP" "DYNAMIC" "EACH" "ECHO" "EDITPROC" "ELEMENT" "ELSE" "ELSEIF", "EMPTY" "ENABLED" "ENCLOSED" "ENCODING" "ENCRYPTION" "END" "END-EXEC" "ENDING" "END_FRAME" "END_PARTITION" "EQ" "EQUALS" "ERASE" "ERRLVL" "ERROR" "ERRORFILES", "ERRORTABLES" "ESCAPE" "ESCAPED" "ET" "EVERY" "EXCEPT" "EXCEPTION" "EXCLUSIVE" "EXEC" "EXECUTE" "EXISTS" "EXIT" "EXP" "EXPLAIN" "EXTERNAL" "EXTRACT" "FALLBACK "FALSE" "FASTEXPORT" "FENCED" "FETCH" "FIELDPROC" "FILE" "FILLFACTOR" "FILTER" "FINAL" "FIRST" "FIRST_VALUE" "FLOAT" "FLOAT4" "FLOAT8" "FLOOR" "FOR" "FORCE" "FOREIGN" "FORMAT" "FOUND" "FRAME_ROW" "FREE" "FREESPACE" "FREETEXT" "FREETEXTTABLE" "FREEZE" "FROM" "FULL" "FULLTEXT" "FUNCTION" "FUSION" "GE" "GENERAL" "GENERATED" "GET" "GIVE" "GLOBAL" "GO" "GOTO" "GRANT" "GRAPHIC" "GROUP" "GROUPING" "GROUPS" "GT" "HANDLER" "HASH" "HASHAMP" "HASHBAKAMP" "HASHBUCKET" "HASHROW" "HAVING" "HELP" "HIGH_PRIORITY" "HOLD" "HOLDLOCK" "HOUR" "HOURS" "HOUR_MICROSECOND" "HOUR_MINUTE" "HOUR_SECOND" "IDENTIFIED" "IDENTITY" "IDENTITYCOL" "IDENTITY_INSERT" "IF" "IGNORE" "ILIKE" "IMMEDIATE" "IN" "INCLUSIVE" "INCONSISTENT" "INCREMENT" "INDEX" "INDICATOR" "INFILE" "INHERIT" "INITIAL" "INITIALIZE" "INITIALLY" "INITIATE" "INNER" "INOUT" "INPUT" "INS" "INSENSITIVE" "INSERT" "INSTEAD" "INT" "INT1" "INT2" "INT3" "INT4" "INT8" "INTEGER" "INTEGERDATE" "INTERSECT" "INTERSECTION" "INTERVAL" "INTO" "IO_AFTER_GTIDS" "IO_BEFORE_GTIDS" "IS" "ISNULL" "ISOBID" "ISOLATION" "ITERATE" "JAR" "JOIN" "JOURNAL" "JSON_ARRAY" "JSON_ARRAYAGG" "JSON_EXISTS" "JSON_OBJECT" "JSON_OBJECTAGG" "JSON_QUERY" "JSON_TABLE" "JSON_TABLE_PRIMITIVE" "JSON_VALUE" "KEEP" "KEY" "KEYS" "KILL" "KURTOSIS" "LABEL" "LAG" "LANGUAGE" "LARGE" "LAST" "LAST_VALUE" "LATERAL" "LC_CTYPE" "LE" "LEAD" "LEADING" "LEAVE" "LEFT" "LESS" "LEVEL" "LIKE" "LIKE_REGEX" "LIMIT" "LINEAR" "LINENO" "LINES" "LISTAGG" "LN" "LOAD" "LOADING" "LOCAL" "LOCALE" "LOCALTIME" "LOCALTIMESTAMP" "LOCATOR" "LOCATORS" "LOCK" "LOCKING" "LOCKMAX" "LOCKSIZE" "LOG" "LOG10" "LOGGING" "LOGON" "LONG" "LONGBLOB" "LONGTEXT" "LOOP" "LOWER" "LOW_PRIORITY" "LT" "MACRO" "MAINTAINED" "MAP" "MASTER_BIND" "MASTER_SSL_VERIFY_SERVER_CERT" "MATCH" "MATCHES" "MATCH_NUMBER" "MATCH_RECOGNIZE" "MATERIALIZED" "MAVG" "MAX" "MAXEXTENTS" "MAXIMUM" "MAXVALUE" "MCHARACTERS" "MDIFF" "MEDIUMBLOB" "MEDIUMINT" "MEDIUMTEXT" "MEMBER" "MERGE" "METHOD" "MICROSECOND" "MICROSECONDS" "MIDDLEINT" "MIN" "MINDEX" Query components and syntax 135 |
acw-ug-057 | acw-ug.pdf | 57 | "ISNULL" "ISOBID" "ISOLATION" "ITERATE" "JAR" "JOIN" "JOURNAL" "JSON_ARRAY" "JSON_ARRAYAGG" "JSON_EXISTS" "JSON_OBJECT" "JSON_OBJECTAGG" "JSON_QUERY" "JSON_TABLE" "JSON_TABLE_PRIMITIVE" "JSON_VALUE" "KEEP" "KEY" "KEYS" "KILL" "KURTOSIS" "LABEL" "LAG" "LANGUAGE" "LARGE" "LAST" "LAST_VALUE" "LATERAL" "LC_CTYPE" "LE" "LEAD" "LEADING" "LEAVE" "LEFT" "LESS" "LEVEL" "LIKE" "LIKE_REGEX" "LIMIT" "LINEAR" "LINENO" "LINES" "LISTAGG" "LN" "LOAD" "LOADING" "LOCAL" "LOCALE" "LOCALTIME" "LOCALTIMESTAMP" "LOCATOR" "LOCATORS" "LOCK" "LOCKING" "LOCKMAX" "LOCKSIZE" "LOG" "LOG10" "LOGGING" "LOGON" "LONG" "LONGBLOB" "LONGTEXT" "LOOP" "LOWER" "LOW_PRIORITY" "LT" "MACRO" "MAINTAINED" "MAP" "MASTER_BIND" "MASTER_SSL_VERIFY_SERVER_CERT" "MATCH" "MATCHES" "MATCH_NUMBER" "MATCH_RECOGNIZE" "MATERIALIZED" "MAVG" "MAX" "MAXEXTENTS" "MAXIMUM" "MAXVALUE" "MCHARACTERS" "MDIFF" "MEDIUMBLOB" "MEDIUMINT" "MEDIUMTEXT" "MEMBER" "MERGE" "METHOD" "MICROSECOND" "MICROSECONDS" "MIDDLEINT" "MIN" "MINDEX" Query components and syntax 135 Amazon CloudWatch User Guide "MINIMUM" "MINUS" "MINUTE" "MINUTES" "MINUTE_MICROSECOND" "MINUTE_SECOND" "MLINREG" "MLOAD" "MLSLABEL" "MOD" "MODE" "MODIFIES" "MODIFY" "MODULE" "MONITOR" "MONRESOURCE" "MONSESSION" "MONTH" "MONTHS" "MSUBSTR" "MSUM" "MULTISET" "NAMED" "NAMES" "NATIONAL" "NATURAL" "NCHAR" "NCLOB" "NE" "NESTED_TABLE_ID" "NEW" "NEW_TABLE" "NEXT" "NEXTVAL" "NO" "NOAUDIT" "NOCHECK" "NOCOMPRESS" "NONCLUSTERED" "NONE" "NORMALIZE" "NOT" "NOTNULL" "NOWAIT" "NO_WRITE_TO_BINLOG" "NTH_VALUE" "NTILE" "NULL" "NULLIF" "NULLIFZERO" "NULLS" "NUMBER" "NUMERIC" "NUMPARTS" "OBID" "OBJECT" "OBJECTS" "OCCURRENCES_REGEX" "OCTET_LENGTH" "OF" "OFF" "OFFLINE" "OFFSET" "OFFSETS" "OLD" "OLD_TABLE" "OMIT" "ON" "ONE" "ONLINE" "ONLY" "OPEN" "OPENDATASOURCE" "OPENQUERY" "OPENROWSET" "OPENXML" "OPERATION" "OPTIMIZATION" "OPTIMIZE" "OPTIMIZER_COSTS" "OPTION" "OPTIONALLY" "OR" "ORDER" "ORDINALITY" "ORGANIZATION" "OUT" "OUTER" "OUTFILE" "OUTPUT" "OVER" "OVERLAPS" "OVERLAY" "OVERRIDE" "PACKAGE" "PAD" "PADDED" "PARAMETER" "PARAMETERS" "PART" "PARTIAL" "PARTITION" "PARTITIONED" "PARTITIONING" "PASSWORD" "PATH" "PATTERN" "PCTFREE" "PER" "PERCENT" "PERCENTILE" "PERCENTILE_CONT" "PERCENTILE_DISC" "PERCENT_RANK" "PERIOD" "PERM" "PERMANENT" "PIECESIZE" "PIVOT" "PLACING" "PLAN" "PORTION" "POSITION" "POSITION_REGEX" "POSTFIX" "POWER" "PRECEDES" "PRECISION" "PREFIX" "PREORDER" "PREPARE" "PRESERVE" "PREVVAL" "PRIMARY" "PRINT" "PRIOR" "PRIQTY" "PRIVATE" "PRIVILEGES" "PROC" "PROCEDURE" "PROFILE" "PROGRAM" "PROPORTIONAL" "PROTECTION" "PSID" "PTF" "PUBLIC" "PURGE" "QUALIFIED" "QUALIFY" "QUANTILE" "QUERY" "QUERYNO" "RADIANS" "RAISERROR" "RANDOM" "RANGE" "RANGE_N" "RANK" "RAW" "READ" "READS" "READTEXT" "READ_WRITE" "REAL" "RECONFIGURE" "RECURSIVE" "REF" "REFERENCES" "REFERENCING" "REFRESH" "REGEXP" "REGR_AVGX" "REGR_AVGY" "REGR_COUNT" "REGR_INTERCEPT" "REGR_R2" "REGR_SLOPE" "REGR_SXX" "REGR_SXY" "REGR_SYY" "RELATIVE" "RELEASE" "RENAME" "REPEAT" "REPLACE" "REPLICATION" "REPOVERRIDE" "REQUEST" "REQUIRE" "RESIGNAL" "RESOURCE" "RESTART" "RESTORE" "RESTRICT" "RESULT" "RESULT_SET_LOCATOR" "RESUME" "RET" "RETRIEVE" "RETURN" "RETURNING" "RETURNS" "REVALIDATE" "REVERT" "REVOKE" "RIGHT" "RIGHTS" "RLIKE" "ROLE" "ROLLBACK" "ROLLFORWARD" "ROLLUP" "ROUND_CEILING" "ROUND_DOWN" "ROUND_FLOOR" "ROUND_HALF_DOWN" "ROUND_HALF_EVEN" "ROUND_HALF_UP" "ROUND_UP" "ROUTINE" "ROW" "ROWCOUNT" "ROWGUIDCOL" "ROWID" "ROWNUM" "ROWS" "ROWSET" "ROW_NUMBER" "RULE" "RUN" "RUNNING" "SAMPLE" "SAMPLEID" "SAVE" "SAVEPOINT" "SCHEMA" "SCHEMAS" "SCOPE" "SCRATCHPAD" "SCROLL" "SEARCH" "SECOND" "SECONDS" "SECOND_MICROSECOND" "SECQTY" "SECTION" "SECURITY" "SECURITYAUDIT" "SEEK" "SEL" "SELECT" "SEMANTICKEYPHRASETABLE" "SEMANTICSIMILARITYDETAILSTABLE" "SEMANTICSIMILARITYTABLE" "SENSITIVE" "SEPARATOR" "SEQUENCE" "SESSION" "SESSION_USER" "SET" "SETRESRATE" "SETS" "SETSESSRATE" "SETUSER" "SHARE" "SHOW" "SHUTDOWN" "SIGNAL" "SIMILAR" "SIMPLE" "SIN" "SINH" "SIZE" "SKEW" "SKIP" "SMALLINT" "SOME" "SOUNDEX" "SOURCE" "SPACE" "SPATIAL" "SPECIFIC" "SPECIFICTYPE" "SPOOL" "SQL" "SQLEXCEPTION" "SQLSTATE" "SQLTEXT" "SQLWARNING" "SQL_BIG_RESULT" "SQL_CALC_FOUND_ROWS" "SQL_SMALL_RESULT" "SQRT" "SS" "SSL" "STANDARD" "START" "STARTING" "STARTUP" "STAT" "STATE" "STATEMENT" "STATIC" "STATISTICS" "STAY" "STDDEV_POP" "STDDEV_SAMP" "STEPINFO" "STOGROUP" "STORED" "STORES" Query components and syntax 136 Amazon CloudWatch User Guide "STRAIGHT_JOIN" "STRING_CS" "STRUCTURE" "STYLE" "SUBMULTISET" "SUBSCRIBER" "SUBSET" "SUBSTR" "SUBSTRING" "SUBSTRING_REGEX" "SUCCEEDS" "SUCCESSFUL" "SUM" "SUMMARY" "SUSPEND" "SYMMETRIC" "SYNONYM" "SYSDATE" "SYSTEM" "SYSTEM_TIME" "SYSTEM_USER" "SYSTIMESTAMP" "TABLE" "TABLESAMPLE" "TABLESPACE" "TAN" "TANH" "TBL_CS" "TEMPORARY" "TERMINATE" "TERMINATED" "TEXTSIZE" "THAN" "THEN" "THRESHOLD" "TIME" "TIMESTAMP" "TIMEZONE_HOUR" "TIMEZONE_MINUTE" "TINYBLOB" "TINYINT" "TINYTEXT" "TITLE" "TO" "TOP" "TRACE" "TRAILING" "TRAN" "TRANSACTION" "TRANSLATE" "TRANSLATE_CHK" "TRANSLATE_REGEX" "TRANSLATION" "TREAT" "TRIGGER" "TRIM" "TRIM_ARRAY" "TRUE" "TRUNCATE" "TRY_CONVERT" "TSEQUAL" "TYPE" "UC" "UESCAPE" "UID" "UNDEFINED" "UNDER" "UNDO" "UNION" "UNIQUE" "UNKNOWN" "UNLOCK" "UNNEST" "UNPIVOT" "UNSIGNED" "UNTIL" "UPD" "UPDATE" "UPDATETEXT" "UPPER" "UPPERCASE" "USAGE" "USE" "USER" "USING" "UTC_DATE" "UTC_TIME" "UTC_TIMESTAMP" "VALIDATE" "VALIDPROC" "VALUE" "VALUES" "VALUE_OF" "VARBINARY" "VARBYTE" "VARCHAR" "VARCHAR2" "VARCHARACTER" "VARGRAPHIC" "VARIABLE" "VARIADIC" "VARIANT" "VARYING" "VAR_POP" "VAR_SAMP" "VCAT" "VERBOSE" "VERSIONING" "VIEW" "VIRTUAL" "VOLATILE" "VOLUMES" "WAIT" "WAITFOR" "WHEN" "WHENEVER" "WHERE" "WHILE" "WIDTH_BUCKET" "WINDOW" "WITH" "WITHIN" "WITHIN_GROUP" "WITHOUT" "WLM" "WORK" "WRITE" "WRITETEXT" "XMLCAST" "XMLEXISTS" "XMLNAMESPACES" "XOR" "YEAR" "YEARS" "YEAR_MONTH" "ZEROFILL" "ZEROIFNULL" "ZONE" Alarms on CloudWatch Metrics Insights queries in CloudWatch You can create alarms on Metrics Insights queries. This helps you have alarms that track multiple resources without needing to be updated later. The query catches new resources and resources that change. For example, you can create an alarm that watches the CPU utilization of your fleet, and the alarm automatically evaluates new instances that you launch after creating the alarm. In a monitoring account that is set up for CloudWatch cross-account observability, your Metrics Insights alarms can watch resources in source accounts and in the monitoring account itself. For more information about how to limit your alarm queries to a specific account or to group the results by account ID, see the WHERE and GROUP BY sections in Query components and syntax in CloudWatch Metrics Insights. Contents • Creating a Metrics Insights CloudWatch alarm • How partial data from a Metrics Insights query is evaluated Alarms on queries 137 Amazon CloudWatch User Guide Creating a Metrics Insights CloudWatch alarm To create an alarm on a Metrics Insights query using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Metrics, All metrics. (Optional) To run a pre-built sample query, choose Add query and select the query to run. Or, you can choose Editor to edit the sample query and then choose Run to run the modified query. To create your |
acw-ug-058 | acw-ug.pdf | 58 | • Creating a Metrics Insights CloudWatch alarm • How partial data from a Metrics Insights query is evaluated Alarms on queries 137 Amazon CloudWatch User Guide Creating a Metrics Insights CloudWatch alarm To create an alarm on a Metrics Insights query using the console 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. 4. In the navigation pane, choose Metrics, All metrics. (Optional) To run a pre-built sample query, choose Add query and select the query to run. Or, you can choose Editor to edit the sample query and then choose Run to run the modified query. To create your own query, choose Multi source query. You can then use the Builder view, the Editor view, and also use a combination of both. You can switch between the two views anytime and see your work in progress in both views. In the Builder view, you can browse and select the metric namespace, metric name, filter, group, and order options. For each of these options, the query builder offers you a list of possible selections from your environment to choose from. In the Editor view, you can start writing your query. As you type, the editor offers suggestions based on the characters that you have typed so far. Important To set an alarm on a Metrics Insights query, the query must return a single time series. If it contains a GROUP BY statement, the GROUP BY statement must be wrapped inside a metric math expression that returns only one time series as the final result of the expression. 5. When you are satisfied with your query, choose Run. 6. Choose Create alarm. 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. Alarms on queries 138 Amazon CloudWatch User Guide 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. c. 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. 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. To have the alarm not send notifications, choose Remove. 10. To have the alarm perform Auto Scaling, EC2, or Systems Manager actions, choose the appropriate button and choose the alarm state and action to perform. Alarms can perform Systems Manager actions only when they go into ALARM state. For more information about Systems Manager actions, 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. 11. When finished, choose Next. 12. Enter a name and description for the alarm. The name must contain only ASCII characters. Then choose Next. 13. Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm. To create an alarm on a Metrics Insights query using the AWS CLI • Use the put-metric-alarm command and specify a Metrics Insights query in the metrics parameter. For example, the following command sets an alarm that goes into ALARM state if any of your instances go above 50% in CPU utilization. Alarms on queries 139 Amazon CloudWatch User Guide aws cloudwatch put-metric-alarm --alarm-name Metrics-Insights-alarm -- evaluation-periods 1 --comparison-operator GreaterThanThreshold --metrics '[{"Id":"m1","Expression":"SELECT MAX(CPUUtilization) FROM SCHEMA(\"AWS/EC2\", InstanceId)", "Period":60}]' --threshold 50 How partial data from a Metrics Insights query is evaluated If the Metrics Insights query used for the alarm matches more than 10,000 metrics, the alarm is evaluated based on the first 10,000 metrics that the query finds. This means that the alarm is being evaluated on partial data. You can use the following methods to find whether a Metrics Insights alarm is currently evaluating its alarm state based on partial data: • In the console, if you choose an alarm to see the Details page, the message Evaluation warning: Not evaluating all data appears on that page. • You see the value PARTIAL_DATA in the EvaluationState field when you use the describe- alarms AWS CLI command or the DescribeAlarms API. |
acw-ug-059 | acw-ug.pdf | 59 | than 10,000 metrics, the alarm is evaluated based on the first 10,000 metrics that the query finds. This means that the alarm is being evaluated on partial data. You can use the following methods to find whether a Metrics Insights alarm is currently evaluating its alarm state based on partial data: • In the console, if you choose an alarm to see the Details page, the message Evaluation warning: Not evaluating all data appears on that page. • You see the value PARTIAL_DATA in the EvaluationState field when you use the describe- alarms AWS CLI command or the DescribeAlarms API. Alarms also publish events to Amazon EventBridge when it goes into the partial data state, so you can create an EventBridge rule to watch for these events. In these events, the evaluationState field has the value PARTIAL_DATA. The following is an example. { "version": "0", "id": "12345678-3bf9-6a09-dc46-12345EXAMPLE", "detail-type": "CloudWatch Alarm State Change", "source": "aws.cloudwatch", "account": "123456789012", "time": "2022-11-08T11:26:05Z", "region": "us-east-1", "resources": [ "arn:aws:cloudwatch:us-east-1:123456789012:alarm:my-alarm-name" ], "detail": { "alarmName": "my-alarm-name", "state": { "value": "ALARM", Alarms on queries 140 Amazon CloudWatch User Guide "reason": "Threshold Crossed: 3 out of the last 3 datapoints [20000.0 (08/11/22 11:25:00), 20000.0 (08/11/22 11:24:00), 20000.0 (08/11/22 11:23:00)] were greater than the threshold (0.0) (minimum 1 datapoint for OK -> ALARM transition).", "reasonData": "{\"version\":\"1.0\",\"queryDate\": \"2022-11-08T11:26:05.399+0000\",\"startDate\":\"2022-11-08T11:23:00.000+0000\", \"period\":60,\"recentDatapoints\":[20000.0,20000.0,20000.0],\"threshold\":0.0, \"evaluatedDatapoints\":[{\"timestamp\":\"2022-11-08T11:25:00.000+0000\",\"value \":20000.0}]}", "timestamp": "2022-11-08T11:26:05.401+0000", "evaluationState": "PARTIAL_DATA" }, "previousState": { "value": "INSUFFICIENT_DATA", "reason": "Unchecked: Initial alarm creation", "timestamp": "2022-11-08T11:25:51.227+0000" }, "configuration": { "metrics": [ { "id": "m2", "expression": "SELECT SUM(PartialDataTestMetric) FROM partial_data_test", "returnData": true, "period": 60 } ] } } } If the query for the alarm includes a GROUP BY statement that initially returns more than 500 time series, the alarm is evaluated based on the first 500 time series that the query finds. However, if you use an ORDER BY clause, then all the time series that the query finds are sorted, and the 500 that have the highest or lowest values according to your ORDER BY clause are used to evaluate the alarm. Use Metrics Insights queries with metric math You can use a Metrics Insights query as an input to a metric math function. For more information about metric math, see Using math expressions with CloudWatch metrics. Use Metrics Insights queries with metric math 141 Amazon CloudWatch User Guide A Metrics Insights query that does not include a GROUP BY clause returns a single time series. Therefore, its returned results can be used with any metric math function that takes a single time series as input. A Metrics Insights query that includes a GROUP BY clause returns multiple time series. Therefore, its returned results can be used with any metric math function that takes an array of time series as input. For example, the following query returns the total number of bytes downloaded for each bucket in the Region, as an array of time series: SELECT SUM(BytesDownloaded) FROM SCHEMA("AWS/S3", BucketName, FilterId) WHERE FilterId = 'EntireBucket' GROUP BY BucketName On a graph in the console or in a GetMetricData operation, the results of this query are q1. This query returns the result in bytes, so if you want to see the result as MB instead, you can use the following math function: q1/1024/1024 Use natural language to generate and update CloudWatch Metrics Insights queries CloudWatch supports a natural language query capability to help you generate and update queries for CloudWatch Metrics Insights and CloudWatch Logs Insights. With this capability, you can ask questions about or describe the CloudWatch data you're looking for in plain English. The natural language capability generates a query based on a prompt that you enter and provides a line-by-line explanation of how the query works. You can also update your query to further investigate your data. Depending on your environment, you can enter prompts like "Which Amazon Elastic Compute Cloud instance has the highest network out?" and "Show me the top 10 Amazon DynamoDB Tables by consumed reads." Use natural language to generate and update CloudWatch Metrics Insights queries 142 Amazon CloudWatch Note User Guide The natural-language query feature is generally available in 10 Regions. For some Regions, the feature makes cross-Region calls to Regions in the United States to process the query prompts. The following table lists the supported Regions, and shows where each Region processes its prompts. Supported Region Region where prompt is processed US East (N. Virginia) US East (N. Virginia) US East (Ohio) US East (N. Virginia) US West (Oregon) US West (Oregon) Asia Pacific (Hong Kong) US West (Oregon) Asia Pacific (Singapore) US West (Oregon) Asia Pacific (Sydney) US West (Oregon) Asia Pacific (Tokyo) Asia Pacific (Tokyo) Europe (Frankfurt) Europe (Frankfurt) Europe (Ireland) US East (N. Virginia) Europe (Stockholm) US East (N. Virginia) To generate a CloudWatch Metrics Insights query with this capability, open the CloudWatch Metrics Insights query editor in the |
acw-ug-060 | acw-ug.pdf | 60 | lists the supported Regions, and shows where each Region processes its prompts. Supported Region Region where prompt is processed US East (N. Virginia) US East (N. Virginia) US East (Ohio) US East (N. Virginia) US West (Oregon) US West (Oregon) Asia Pacific (Hong Kong) US West (Oregon) Asia Pacific (Singapore) US West (Oregon) Asia Pacific (Sydney) US West (Oregon) Asia Pacific (Tokyo) Asia Pacific (Tokyo) Europe (Frankfurt) Europe (Frankfurt) Europe (Ireland) US East (N. Virginia) Europe (Stockholm) US East (N. Virginia) To generate a CloudWatch Metrics Insights query with this capability, open the CloudWatch Metrics Insights query editor in the builder or editor view and choose Generate query. Important To use the natural language query capability, you must use the CloudWatchFullAccess, CloudWatchReadOnlyAccess, CloudWatchFullAccessV2, AdministratorAccess, or ReadOnlyAccess policy. Use natural language to generate and update CloudWatch Metrics Insights queries 143 Amazon CloudWatch User Guide You can also include the cloudwatch:GenerateQuery action in a new or existing customer managed or inline policy. Example queries The examples in this section describe how to generate and update queries using the natural language capability. Note For more information on the CloudWatch Metrics Insights query editor and syntax, see CloudWatch Metrics Insights query components and syntax. Example: Generate a natural language query To generate a query using natural language, enter a prompt and choose Generate new query. This example shows a query that performs a basic search. Prompt The following is an example of a prompt that directs the capability to search for the top 10 DynamoDB Tables that consume the most read capacity. Show top 10 DynamoDB Tables by consumed reads Query The following is an example of a query that the natural language capability generates based on the prompt. Notice how the prompt appears in a comment before the query. After the query, you can read an explanation that describes how the query works. # Show top 10 DynamoDB Tables by consumed reads SELECT SUM("ConsumedReadCapacityUnits") FROM "AWS/DynamoDB" GROUP BY TableName ORDER BY SUM() DESC LIMIT 10 Use natural language to generate and update CloudWatch Metrics Insights queries 144 Amazon CloudWatch User Guide # This query selects the sum of consumed read capacity units for each DynamoDB table, groups the results by table name, orders the results from highest to lowest read capacity consumption, and limits the results to the top 10 tables. Note To turn off the appearance of your prompt and the explanation of how the query works, use the gear icon in your editor. Example: Update a natural language query You can update a query by editing the initial prompt and then choosing Update query. Updated prompt The following example shows an updated version of the previous prompt. Instead of a prompt that searches for the top 10 DynamoDB Tables that consume the most read capacity, this prompt now directs the capability to sort the results by the number of bytes returned. Sort by bytes returned instead Updated query The following is an example of the updated query. Notice how the updated prompt appears in a comment before the updated query. After the query, you can read an explanation that describes how the original query has been updated. # Sort by bytes returned instead SELECT SUM("ReturnedBytes") FROM "AWS/DynamoDB" GROUP BY TableName ORDER BY SUM() DESC LIMIT 10 # This query modifies the original query to select the sum of returned bytes instead of consumed read capacity units, and orders the results from highest to lowest sum of returned bytes, limiting the results to the top 10 tables. Use natural language to generate and update CloudWatch Metrics Insights queries 145 Amazon CloudWatch User Guide Opting out of using your data for service improvement The natural language prompt data you provide to train the AI model and generate relevant queries is used solely to provide and maintain your service. This data might be used to improve the quality of CloudWatch Metrics Insights. Your trust and privacy, as well as the security of your content, is our highest priority. For more information, see AWS Service Terms and AWS responsible AI policy. You can opt out of having your content used to develop or improve the quality of natural language queries by creating an AI service opt-out policy. To opt-out of data collection for all CloudWatch AI features, including the query generation capability, you must create an opt-out policy for CloudWatch. For more information, see AI services opt-out policies in the AWS Organizations User Guide. SQL inference CloudWatch Metrics Insights uses several mechanisms to infer the intention of a given SQL query. Topics • Time bucketing • Fields projection • ORDER BY global aggregation Time bucketing Time series data points resulting from a query are rolled up into time buckets based on the requested period. To aggregate values in standard SQL, an explicit GROUP BY clause |
acw-ug-061 | acw-ug.pdf | 61 | opt-out policy. To opt-out of data collection for all CloudWatch AI features, including the query generation capability, you must create an opt-out policy for CloudWatch. For more information, see AI services opt-out policies in the AWS Organizations User Guide. SQL inference CloudWatch Metrics Insights uses several mechanisms to infer the intention of a given SQL query. Topics • Time bucketing • Fields projection • ORDER BY global aggregation Time bucketing Time series data points resulting from a query are rolled up into time buckets based on the requested period. To aggregate values in standard SQL, an explicit GROUP BY clause must be defined to collect all the observations of a given period together. Because this is the standard way to query time series data, CloudWatch Metrics Insights infers time bucketing without the need to express an explicit GROUP BY clause. For example, when a query is performed with a period of one minute, all the observations belonging to that minute until the next (excluded) are rolled up to the start time of the time bucket. This makes Metrics Insights SQL statements more concise and less verbose. SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) SQL inference 146 Amazon CloudWatch User Guide The previous query returns a single time series (timestamp-value pairs), representing the average CPU utilization of all Amazon EC2 instances. Assuming the requested period is one minute, each data point returned represents the average of all observations measured within a specific one- minute interval (start time inclusive, end time exclusive). The timestamp related to the specific data point is the start time of the bucket Fields projection Metrics Insights queries always return the timestamp projection. You don’t need to specify a timestamp column in the SELECT clause to get the timestamp of each corresponding data point value. For details about how timestamp is calculated, see Time bucketing. When using GROUP BY, each group name is also inferred and projected in the result, so that you can group the returned time series. SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) GROUP BY InstanceId The previous query returns a time series for each Amazon EC2 instance. Each time series is labeled after the value of the instance ID. ORDER BY global aggregation When using ORDER BY, FUNCTION() infers which aggregate function that you want to order by (the data point values of the queried metrics). The aggregate operation is performed across all the matched data points of each individual time series across the queried time window. SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) GROUP BY InstanceId ORDER BY MAX() LIMIT 10 The previous query returns the CPU utilization for each Amazon EC2 instance, limiting the result set to 10 entries. The results are ordered based on the maximum value of the individual time series within the requested time window. The ORDER BY clause is applied before LIMIT, so that the ordering is calculated against more than 10 time series. SQL inference 147 Amazon CloudWatch User Guide Metrics Insights sample queries This section contains examples of useful CloudWatch Metrics Insights queries that you can copy and use directly or copy and modify in query editor. Some of these examples are already available in the console, and you can access them by choosing Add query in the Metrics view. Application Load Balancer examples Total requests across all load balancers SELECT SUM(RequestCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer) Top 10 most active load balancers SELECT MAX(ActiveConnectionCount) FROM SCHEMA("AWS/ApplicationELB", LoadBalancer) GROUP BY LoadBalancer ORDER BY SUM() DESC LIMIT 10 AWS API usage examples Top 20 AWS APIs by the number of calls in your account SELECT COUNT(CallCount) FROM SCHEMA("AWS/Usage", Class, Resource, Service, Type) WHERE Type = 'API' GROUP BY Service, Resource ORDER BY COUNT() DESC LIMIT 20 CloudWatch APIs sorted by calls SELECT COUNT(CallCount) FROM SCHEMA("AWS/Usage", Class, Resource, Service, Type) WHERE Type = 'API' AND Service = 'CloudWatch' GROUP BY Resource ORDER BY COUNT() DESC Sample queries 148 User Guide Amazon CloudWatch DynamoDB examples Top 10 tables by consumed reads SELECT SUM(ProvisionedWriteCapacityUnits) FROM SCHEMA("AWS/DynamoDB", TableName) GROUP BY TableName ORDER BY MAX() DESC LIMIT 10 Top 10 tables by returned bytes SELECT SUM(ReturnedBytes) FROM SCHEMA("AWS/DynamoDB", TableName) GROUP BY TableName ORDER BY MAX() DESC LIMIT 10 Top 10 tables by user errors SELECT SUM(UserErrors) FROM SCHEMA("AWS/DynamoDB", TableName) GROUP BY TableName ORDER BY MAX() DESC LIMIT 10 Amazon Elastic Block Store examples Top 10 Amazon EBS volumes by bytes written SELECT SUM(VolumeWriteBytes) FROM SCHEMA("AWS/EBS", VolumeId) GROUP BY VolumeId ORDER BY SUM() DESC LIMIT 10 Average Amazon EBS volume write time SELECT AVG(VolumeTotalWriteTime) FROM SCHEMA("AWS/EBS", VolumeId) Amazon EC2 examples CPU utilization of EC2 instances sorted by highest Sample queries 149 Amazon CloudWatch User Guide SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) GROUP BY InstanceId ORDER BY AVG() DESC Average CPU utilization across the entire fleet SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) Top 10 instances by highest CPU utilization SELECT MAX(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) |
acw-ug-062 | acw-ug.pdf | 62 | BY TableName ORDER BY MAX() DESC LIMIT 10 Amazon Elastic Block Store examples Top 10 Amazon EBS volumes by bytes written SELECT SUM(VolumeWriteBytes) FROM SCHEMA("AWS/EBS", VolumeId) GROUP BY VolumeId ORDER BY SUM() DESC LIMIT 10 Average Amazon EBS volume write time SELECT AVG(VolumeTotalWriteTime) FROM SCHEMA("AWS/EBS", VolumeId) Amazon EC2 examples CPU utilization of EC2 instances sorted by highest Sample queries 149 Amazon CloudWatch User Guide SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) GROUP BY InstanceId ORDER BY AVG() DESC Average CPU utilization across the entire fleet SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) Top 10 instances by highest CPU utilization SELECT MAX(CPUUtilization) FROM SCHEMA("AWS/EC2", InstanceId) GROUP BY InstanceId ORDER BY MAX() DESC LIMIT 10 In this case, the CloudWatch agent is collecting a CPUUtilization metric per application. This query filters the average of this metric for a specific application name. SELECT AVG(CPUUtilization) FROM "AWS/CWAgent" WHERE ApplicationName = 'eCommerce' Amazon Elastic Container Service examples Average CPU utilization across all ECS clusters SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/ECS", ClusterName) Top 10 clusters by memory utilization SELECT AVG(MemoryUtilization) FROM SCHEMA("AWS/ECS", ClusterName) GROUP BY ClusterName ORDER BY AVG() DESC LIMIT 10 Sample queries 150 Amazon CloudWatch User Guide Top 10 services by CPU utilization SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/ECS", ClusterName, ServiceName) GROUP BY ClusterName, ServiceName ORDER BY AVG() DESC LIMIT 10 Top 10 services by running tasks (Container Insights) SELECT AVG(RunningTaskCount) FROM SCHEMA("ECS/ContainerInsights", ClusterName, ServiceName) GROUP BY ClusterName, ServiceName ORDER BY AVG() DESC LIMIT 10 Amazon Elastic Kubernetes Service Container Insights examples Average CPU utilization across all EKS clusters SELECT AVG(pod_cpu_utilization) FROM SCHEMA("ContainerInsights", ClusterName) Top 10 clusters by node CPU utilization SELECT AVG(node_cpu_utilization) FROM SCHEMA("ContainerInsights", ClusterName) GROUP BY ClusterName ORDER BY AVG() DESC LIMIT 10 Top 10 clusters by pod memory utilization SELECT AVG(pop_memory_utilization) FROM SCHEMA("ContainerInsights", ClusterName) GROUP BY ClusterName ORDER BY AVG() DESC LIMIT 10 Top 10 nodes by CPU utilization SELECT AVG(node_cpu_utilization) Sample queries 151 Amazon CloudWatch User Guide FROM SCHEMA("ContainerInsights", ClusterName, NodeName) GROUP BY ClusterName, NodeName ORDER BY AVG() DESC LIMIT 10 Top 10 pods by memory utilization SELECT AVG(pod_memory_utilization) FROM SCHEMA("ContainerInsights", ClusterName, PodName) GROUP BY ClusterName, PodName ORDER BY AVG() DESC LIMIT 10 EventBridge examples Top 10 rules by invocations SELECT SUM(Invocations) FROM SCHEMA("AWS/Events", RuleName) GROUP BY RuleName ORDER BY MAX() DESC LIMIT 10 Top 10 rules by failed invocations SELECT SUM(FailedInvocations) FROM SCHEMA("AWS/Events", RuleName) GROUP BY RuleName ORDER BY MAX() DESC LIMIT 10 Top 10 rules by matched rules SELECT SUM(MatchedEvents) FROM SCHEMA("AWS/Events", RuleName) GROUP BY RuleName ORDER BY MAX() DESC LIMIT 10 Kinesis examples Top 10 streams by bytes written SELECT SUM("PutRecords.Bytes") Sample queries 152 Amazon CloudWatch User Guide FROM SCHEMA("AWS/Kinesis", StreamName) GROUP BY StreamName ORDER BY SUM() DESC LIMIT 10 Top 10 streams by earliest items in the stream SELECT MAX("GetRecords.IteratorAgeMilliseconds") FROM SCHEMA("AWS/Kinesis", StreamName) GROUP BY StreamName ORDER BY MAX() DESC LIMIT 10 Lambda examples Lambda functions ordered by number of invocations SELECT SUM(Invocations) FROM SCHEMA("AWS/Lambda", FunctionName) GROUP BY FunctionName ORDER BY SUM() DESC Top 10 Lambda functions by longest runtime SELECT AVG(Duration) FROM SCHEMA("AWS/Lambda", FunctionName) GROUP BY FunctionName ORDER BY MAX() DESC LIMIT 10 Top 10 Lambda functions by error count SELECT SUM(Errors) FROM SCHEMA("AWS/Lambda", FunctionName) GROUP BY FunctionName ORDER BY SUM() DESC LIMIT 10 CloudWatch Logs examples Top 10 log groups by incoming events Sample queries 153 Amazon CloudWatch User Guide SELECT SUM(IncomingLogEvents) FROM SCHEMA("AWS/Logs", LogGroupName) GROUP BY LogGroupName ORDER BY SUM() DESC LIMIT 10 Top 10 log groups by written bytes SELECT SUM(IncomingBytes) FROM SCHEMA("AWS/Logs", LogGroupName) GROUP BY LogGroupName ORDER BY SUM() DESC LIMIT 10 Amazon RDS examples Top 10 Amazon RDS instances by highest CPU utilization SELECT MAX(CPUUtilization) FROM SCHEMA("AWS/RDS", DBInstanceIdentifier) GROUP BY DBInstanceIdentifier ORDER BY MAX() DESC LIMIT 10 Top 10 Amazon RDS clusters by writes SELECT SUM(WriteIOPS) FROM SCHEMA("AWS/RDS", DBClusterIdentifier) GROUP BY DBClusterIdentifier ORDER BY MAX() DESC LIMIT 10 Amazon Simple Storage Service examples Average latency by bucket SELECT AVG(TotalRequestLatency) FROM SCHEMA("AWS/S3", BucketName, FilterId) WHERE FilterId = 'EntireBucket' GROUP BY BucketName ORDER BY AVG() DESC Sample queries 154 Amazon CloudWatch User Guide Top 10 buckets by bytes downloaded SELECT SUM(BytesDownloaded) FROM SCHEMA("AWS/S3", BucketName, FilterId) WHERE FilterId = 'EntireBucket' GROUP BY BucketName ORDER BY SUM() DESC LIMIT 10 Amazon Simple Notification Service examples Total messages published by SNS topics SELECT SUM(NumberOfMessagesPublished) FROM SCHEMA("AWS/SNS", TopicName) Top 10 topics by messages published SELECT SUM(NumberOfMessagesPublished) FROM SCHEMA("AWS/SNS", TopicName) GROUP BY TopicName ORDER BY SUM() DESC LIMIT 10 Top 10 topics by message delivery failures SELECT SUM(NumberOfNotificationsFailed) FROM SCHEMA("AWS/SNS", TopicName) GROUP BY TopicName ORDER BY SUM() DESC LIMIT 10 Amazon SQS examples Top 10 queues by number of visible messages SELECT AVG(ApproximateNumberOfMessagesVisible) FROM SCHEMA("AWS/SQS", QueueName) GROUP BY QueueName Sample queries 155 User Guide Amazon CloudWatch ORDER BY AVG() DESC LIMIT 10 Top 10 most active queues SELECT SUM(NumberOfMessagesSent) FROM SCHEMA("AWS/SQS", QueueName) GROUP BY QueueName ORDER BY SUM() DESC LIMIT 10 Top 10 queues by age of earliest message SELECT AVG(ApproximateAgeOfOldestMessage) FROM SCHEMA("AWS/SQS", QueueName) GROUP |
acw-ug-063 | acw-ug.pdf | 63 | SELECT SUM(NumberOfMessagesPublished) FROM SCHEMA("AWS/SNS", TopicName) GROUP BY TopicName ORDER BY SUM() DESC LIMIT 10 Top 10 topics by message delivery failures SELECT SUM(NumberOfNotificationsFailed) FROM SCHEMA("AWS/SNS", TopicName) GROUP BY TopicName ORDER BY SUM() DESC LIMIT 10 Amazon SQS examples Top 10 queues by number of visible messages SELECT AVG(ApproximateNumberOfMessagesVisible) FROM SCHEMA("AWS/SQS", QueueName) GROUP BY QueueName Sample queries 155 User Guide Amazon CloudWatch ORDER BY AVG() DESC LIMIT 10 Top 10 most active queues SELECT SUM(NumberOfMessagesSent) FROM SCHEMA("AWS/SQS", QueueName) GROUP BY QueueName ORDER BY SUM() DESC LIMIT 10 Top 10 queues by age of earliest message SELECT AVG(ApproximateAgeOfOldestMessage) FROM SCHEMA("AWS/SQS", QueueName) GROUP BY QueueName ORDER BY AVG() DESC LIMIT 10 Metrics Insights limits CloudWatch Metrics Insights currently has the following limits: • Currently, you can query only the most recent three hours of data. • A single query can process no more than 10,000 metrics. This means that if the SELECT, FROM, and WHERE clauses match more than 10,000 metrics, the query only processes the first 10,000 of these metrics that it finds. • A single query can return no more than 500 time series. This means that if the query would return more than 500 metrics, not all metrics will be returned in the query results. If you use an ORDER BY clause, then all the metrics being processed are sorted, and the 500 that have the highest or lowest values according to your ORDER BY clause are returned. If you do not include an ORDER BY clause, you can't control which 500 matching metrics are returned. • You can have as many as 200 Metrics Insights alarms per Region. • Metrics Insights does not support high-resolution data, which is metric data reported with a granularity of less than one minute. If you request high-resolution data, the request does not fail, but the output is aggregated at one-minute granularity. Metrics Insights limits 156 Amazon CloudWatch User Guide • Each GetMetricData operation can have only one query, but you can have multiple widgets in a dashboard that each include a query. Metrics Insights glossary label In Metrics Insights, a label is a key-value pair that is used to scope a query to return a particular set of data, or to define criteria by which query results are to be separated into separate time series. A label key is similar to a column name in SQL. Currently, labels must be CloudWatch metric dimensions. observation An observation is a value recorded for a given metric at a given time. Troubleshooting Metrics Insights The results include "Other," but I don't have this as a dimension This means that the query includes a GROUP BY clause that specifies a label key that is not used in some of the metrics that are returned by the query. In this case, a null group named Other is returned. The metrics that do not include that label key are probably aggregated metrics that return values aggregated across all values of that label key. For example, suppose we have the following query: SELECT AVG(Faults) FROM MyCustomNamespace GROUP BY Operation, ServiceName If some of the returned metrics don't include ServiceName as a dimension, then those metrics are displayed as having Other as the value for ServiceName. To prevent seeing "Other" in your results, use SCHEMA in your FROM clause, as in the following example: SELECT AVG(Faults) FROM SCHEMA(MyCustomNamespace, Operation) Metrics Insights glossary 157 Amazon CloudWatch User Guide GROUP BY Operation, ServiceName This limits the returned results to only the metrics that have both the Operation and ServiceName dimensions. The oldest timestamp in my graph has a lower metric value than the others CloudWatch Metrics Insights currently supports the latest three hours of data only. When you graph with a period larger than one minute, there could be cases where the oldest data point differs from the expected value. This is because the Metrics Insights queries return only the most recent three hours of data. In this case, the oldest data point in the query returns only the observations that have been measured within the last three hours boundary, instead of returning all the observations within the period of that data point. Use metrics explorer to monitor resources by their tags and properties Metrics explorer is a tag-based tool that enables you to filter, aggregate, and visualize your metrics by tags and resource properties, to enhance observability for your services. This gives you a flexible and dynamic troubleshooting experience, so that you can create multiple graphs at a time and use these graphs to build your application health dashboards. Metrics explorer visualizations are dynamic, so if a matching resource is created after you create a metrics explorer widget and add it to a CloudWatch dashboard, the new resource automatically appears in the explorer widget. For example, if all of your EC2 production |
acw-ug-064 | acw-ug.pdf | 64 | properties Metrics explorer is a tag-based tool that enables you to filter, aggregate, and visualize your metrics by tags and resource properties, to enhance observability for your services. This gives you a flexible and dynamic troubleshooting experience, so that you can create multiple graphs at a time and use these graphs to build your application health dashboards. Metrics explorer visualizations are dynamic, so if a matching resource is created after you create a metrics explorer widget and add it to a CloudWatch dashboard, the new resource automatically appears in the explorer widget. For example, if all of your EC2 production instances have the production tag, you can use metrics explorer to filter and aggregate metrics from all of these instances to understand their health and performance. If a new instance with a matching tag is later created, it's automatically added to the metrics explorer widget. Note Metrics explorer provides a point-in-time experience. Resources that have been terminated, or no longer exist with the property or tag that you specified are not displayed in the visualisation. However, you can still find the metrics for these resources in CloudWatch metrics views. Use metrics explorer to monitor resources by their tags and properties 158 Amazon CloudWatch User Guide With metrics explorer, you can choose how to aggregate metrics from the resources that match the criteria, and whether to show them all in a single graph or on different graphs within one metrics explorer widget. Metrics explorer includes templates that you can use to see useful visualization graphs with one click, and you can also extend these templates to create completely customized metrics explorer widgets. You can use metrics explorer across accounts if you are using the Cross-account cross-Region CloudWatch console. However, metrics explorer is not supported for cross-account use from a monitoring account in CloudWatch cross-account observability. Metrics explorer supports metrics emitted by AWS and EC2 metrics that are published by the CloudWatch agent, including memory, disk, and CPU metrics. To use metrics explorer to see the metrics that are published by the CloudWatch agent, you might have to update your CloudWatch agent configuration file. For more information, see CloudWatch agent configuration for metrics explorer To create a visualization with metrics explorer and optionally add it to a dashboard, follow these steps. To create a visualization with metrics explorer 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. In the navigation pane, choose Explorer. 3. Do one of the following: • To use a template, select it in the box that currently shows Empty Explorer. Depending on the template, the explorer might immediately display graphs of metrics. If it doesn't, choose one or more tags or properties in the From box and then data should appear. If it doesn't, use the options at the top of the page to display a longer time range in the graphs. • To create a custom visualization, under Metrics, choose a single metric or all the available metrics from a service. After you choose a metric, you can optionally repeat this step to add more metrics. 4. For each metric selected, CloudWatch displays the statistic that it will use immediately after the metric name. To change this, choose the statistic name, and then choose the statistic that you want. Use metrics explorer to monitor resources by their tags and properties 159 Amazon CloudWatch User Guide 5. Under From, choose a tag or a resource property to filter your results. After you do this, you can optionally repeat this step to choose more tags or resource properties. If you choose multiple values of the same property, such as two EC2 instance types, the explorer displays all the resources that match either chosen property. It's treated as an OR operation. If you choose different properties or tags, such as the Production tag and the M5 instance type, only the resources that match all of these selections are displayed. It's treated as an AND operation. 6. (Optional) For Aggregate by, choose a statistic to use to aggregate the metrics. Then, next to for, choose how to aggregate the metric from the list. You can aggregate together all the resources that are currently displayed, or aggregate by a single tag or resource property. Depending on how you choose to aggregate, the result may be a single time series or multiple time series. 7. Under Split by, you can choose to split a single graph with multiple time series into multiple graphs. The split can be made by a variety of criteria, which you choose under Split by. 8. Under Graph options, you can refine the graph by changing the period, the type of graph, the legend placement, and the layout. 9. To add this visualization as a widget to a CloudWatch dashboard, choose Add to dashboard. CloudWatch agent configuration for metrics explorer |
acw-ug-065 | acw-ug.pdf | 65 | property. Depending on how you choose to aggregate, the result may be a single time series or multiple time series. 7. Under Split by, you can choose to split a single graph with multiple time series into multiple graphs. The split can be made by a variety of criteria, which you choose under Split by. 8. Under Graph options, you can refine the graph by changing the period, the type of graph, the legend placement, and the layout. 9. To add this visualization as a widget to a CloudWatch dashboard, choose Add to dashboard. CloudWatch agent configuration for metrics explorer To enable metrics explorer to discover EC2 metrics published by the CloudWatch agent, make sure that the CloudWatch agent configuration file contains the following values: • In the metrics section, make sure that the aggregation_dimensions parameter includes ["InstanceId"]. It can also contain other dimensions. • In the metrics section, make sure that the append_dimensions parameter includes a {"InstanceId":"${aws:InstanceId}"} line. It can also contain other lines. • In the metrics section, inside the metrics_collected section, check the sections for each resource type that you want metrics explorer to discover, such as the cpu, disk, and memory sections. Make sure that each of these sections has a "resources": [ "*"] line.. CloudWatch agent configuration for metrics explorer 160 Amazon CloudWatch User Guide • In the cpu section of the metrics_collected section, make sure there is a "totalcpu": true line. • You must use the default CWAgent namespace for the metrics collected by the CloudWatch agent, instead of a custom namespace. The settings in the previous list cause the CloudWatch agent to publish aggregate metrics for disks, CPUs, and other resources that can be plotted in metrics explorer for all the instances that use it. These settings will republish the metrics that you had previously set up to be published with multiple dimensions, adding to your metric costs. For more information about editing the CloudWatch agent configuration file, see Manually create or edit the CloudWatch agent configuration file. Use metric streams You can use metric streams to continually stream CloudWatch metrics to a destination of your choice, with near-real-time delivery and low latency. Supported destinations include AWS destinations such as Amazon Simple Storage Service and several third-party service provider destinations. There are three main usage scenarios for CloudWatch metric streams: • Custom setup with Firehose— Create a metric stream and direct it to an Amazon Data Firehose delivery stream that delivers your CloudWatch metrics to where you want them to go. You can stream them to a data lake such as Amazon S3, or to any destination or endpoint supported by Firehose including third-party providers. JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0 formats are supported natively, or you can configure transformations in your Firehose delivery stream to convert the data to a different format such as Parquet. With a metric stream, you can continually update monitoring data, or combine this CloudWatch metric data with billing and performance data to create rich datasets. You can then use tools such as Amazon Athena to get insight into cost optimization, resource performance, and resource utilization. • Quick S3 setup— Stream to Amazon Simple Storage Service with a quick setup process. By default, CloudWatch creates the resources needed for the stream. JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0 formats are supported. • Quick AWS partner setup— CloudWatch provides a quick setup experience for some third- party partners. You can use third-party service providers to monitor, troubleshoot, and analyze Use metric streams 161 Amazon CloudWatch User Guide your applications using the streamed CloudWatch data. When you use the quick partner setup workflow, you need to provide only a destination URL and API key for your destination, and CloudWatch handles the rest of the setup. Quick partner setup is available for the following third-party providers: • Datadog • Dynatrace • Elastic • New Relic • Splunk Observability Cloud • SumoLogic You can stream all of your CloudWatch metrics, or use filters to stream only specified metrics. Each metric stream can include up to 1000 filters that either include or exclude metric namespaces or specific metrics. A single metric stream can have only include or exclude filters, but not both. After a metric stream is created, if new metrics are created that match the filters in place, the new metrics are automatically included in the stream. There is no limit on the number of metric streams per account or per Region, and no limit on the number of metric updates being streamed. Each stream can use either JSON format, OpenTelemetry 1.0.0, or OpenTelemetry 0.7.0 format. You can edit the output format of a metric stream at any time, such as for upgrading from OpenTelemetry 0.7.0 to OpenTelemetry 1.0.0. For more information about output formats, see CloudWatch metric stream output in JSON format, |
acw-ug-066 | acw-ug.pdf | 66 | metric stream is created, if new metrics are created that match the filters in place, the new metrics are automatically included in the stream. There is no limit on the number of metric streams per account or per Region, and no limit on the number of metric updates being streamed. Each stream can use either JSON format, OpenTelemetry 1.0.0, or OpenTelemetry 0.7.0 format. You can edit the output format of a metric stream at any time, such as for upgrading from OpenTelemetry 0.7.0 to OpenTelemetry 1.0.0. For more information about output formats, see CloudWatch metric stream output in JSON format, CloudWatch metric stream output in OpenTelemetry 1.0.0 format, and CloudWatch metric stream output in OpenTelemetry 0.7.0 format. For metric streams in monitoring accounts, you can choose whether to include metrics from the source accounts linked to that monitoring account. For more information, see CloudWatch cross- account observability. Metric streams always include the Minimum, Maximum, SampleCount, and Sum statistics. You can also choose to include additional statistics at an additional charge. For more information, see Statistics that can be streamed. Use metric streams 162 Amazon CloudWatch User Guide Metric streams pricing is based on the number of metric updates. You also incur charges from Firehose for the delivery stream used for the metric stream. For more information, see Amazon CloudWatch Pricing. Topics • Set up a metric stream • Statistics that can be streamed • Metric stream operation and maintenance • Monitoring your metric streams with CloudWatch metrics • Trust between CloudWatch and Firehose • CloudWatch metric stream output in JSON format • CloudWatch metric stream output in OpenTelemetry 1.0.0 format • CloudWatch metric stream output in OpenTelemetry 0.7.0 format • Troubleshooting metric streams in CloudWatch Set up a metric stream Use the steps in the following sections to set up a CloudWatch metric stream. After a metric stream is created, the time it takes for metric data to appear at the destination depends on the configured buffering settings on the Firehose delivery stream. The buffering is expressed in maximum payload size or maximum wait time, whichever is reached first. If these are set to the minimum values (60 seconds, 1MB) the expected latency is within 3 minutes if the selected CloudWatch namespaces have active metric updates. In a CloudWatch metric stream, data is sent every minute. Data might arrive at the final destination out of order. All specified metrics in the specified namespaces are sent in the metric stream, except metrics with a timestamp that is more than two days old. For each combination of metric name and namespace that you stream, all dimension combinations of that metric name and namespace are streamed. For metric streams in monitoring accounts, you can choose whether to include metrics from the source accounts linked to that monitoring account. For more information, see CloudWatch cross- account observability. Set up a metric stream 163 Amazon CloudWatch User Guide To create and manage metric streams, you must be logged on to an account that has the CloudWatchFullAccess policy and the iam:PassRole permission, or an account that has the following list of permissions: • iam:PassRole • cloudwatch:PutMetricStream • cloudwatch:DeleteMetricStream • cloudwatch:GetMetricStream • cloudwatch:ListMetricStreams • cloudwatch:StartMetricStreams • cloudwatch:StopMetricStreams If you're going to have CloudWatch set up the IAM role needed for metric streams, you must also have the iam:CreateRole and iam:PutRolePolicy permissions. Important A user with the cloudwatch:PutMetricStream has access to the CloudWatch metric data that is being streamed, even if they don't have the cloudwatch:GetMetricData permission. Topics • Custom setup with Firehose • Use Quick Amazon S3 setup • Quick partner setup Custom setup with Firehose Use this method to create a metric stream and direct it to an Amazon Data Firehose delivery stream that delivers your CloudWatch metrics to where you want them to go. You can stream them to a data lake such as Amazon S3, or to any destination or endpoint supported by Firehose including third-party providers. JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0 formats are supported natively, or you can configure transformations in your Firehose delivery stream to convert the data to a different Set up a metric stream 164 Amazon CloudWatch User Guide format such as Parquet. With a metric stream, you can continually update monitoring data, or combine this CloudWatch metric data with billing and performance data to create rich datasets. You can then use tools such as Amazon Athena to get insight into cost optimization, resource performance, and resource utilization. You can use the CloudWatch console, the AWS CLI, AWS CloudFormation, or the AWS Cloud Development Kit (AWS CDK) to set up a metric stream. The Firehose delivery stream that you use for your metric stream must be in the same account and the same Region where you set up the metric stream. To achieve cross-Region functionality, you can configure the |
acw-ug-067 | acw-ug.pdf | 67 | continually update monitoring data, or combine this CloudWatch metric data with billing and performance data to create rich datasets. You can then use tools such as Amazon Athena to get insight into cost optimization, resource performance, and resource utilization. You can use the CloudWatch console, the AWS CLI, AWS CloudFormation, or the AWS Cloud Development Kit (AWS CDK) to set up a metric stream. The Firehose delivery stream that you use for your metric stream must be in the same account and the same Region where you set up the metric stream. To achieve cross-Region functionality, you can configure the Firehose delivery stream to stream to a final destination that is in a different account or a different Region. CloudWatch console This section describes how to use the CloudWatch console to set up a metric stream using Firehose. To set up a custom metric stream using Firehose 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, Streams. Then choose Create metric stream. (Optional) If you are signed in to an account that is set up as a monitoring account in CloudWatch cross-account observability, you can choose whether to include metrics from linked source accounts in this metric stream. To include metrics from source accounts, choose Include source account metrics. 4. Choose Custom setup with Firehose. 5. For Select your Kinesis Data Firehose stream, select the Firehose delivery stream to use. It must be in the same account. The default format for this option is OpenTelemetry 0.7.0, but you can change the format later in this procedure. 6. 7. Then select the Firehose delivery stream to use under Select your Firehose delivery stream. (Optional)You can choose Select existing service role to use an existing IAM role instead of having CloudWatch create a new one for you. (Optional) To change the output format from the default format for your scenario, choose Change output format. The supported formats are JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0. 8. For Metrics to be streamed, choose either All metrics or Select metrics. Set up a metric stream 165 Amazon CloudWatch User Guide If you choose All metrics, all metrics from this account will be included in the stream. Consider carefully whether to stream all metrics, because the more metrics that you stream the higher your metric stream charges will be. If you choose Select metrics, do one of the following: • • To stream most metric namespaces, choose Exclude and select the namespaces or metrics to exclude. When you specify a namespace in Exclude, you can optionally select some specific metrics from that namespace to exclude. If you choose to exclude a namespace but don't then select metrics in that namespace, all metrics from that namespace are excluded. To include only a few metric namespaces or metrics in the metric stream, choose Include and then select the namespaces or metrics to include. If you choose to include a namespace but don't then select metrics in that namespace, all metrics from that namespace are included. 9. (Optional) To stream additional statistics for some of these metrics beyond Minimum, Maximum, SampleCount, and Sum, choose Add additional statistics. Either choose Add recommended metrics to add some commonly used statistics, or manually select the namespace and metric name to stream additional statistics for. Next, select the additional statistics to stream. To then choose another group of metrics to stream a different set of additional statistics for, choose Add additional statistics. Each metric can include as many as 20 additional statistics, and as many as 100 metrics within a metric stream can include additional statistics. Streaming additional statistics incurs more charges. For more information, see Statistics that can be streamed. For definitions of the additional statistics, see CloudWatch statistics definitions. 10. (Optional) Customize the name of the new metric stream under Metric stream name. 11. Choose Create metric stream. AWS CLI or AWS API Use the following steps to create a CloudWatch metric stream. Set up a metric stream 166 Amazon CloudWatch User Guide To use the AWS CLI or AWS API to create a metric stream 1. If you're streaming to Amazon S3, first create the bucket. For more information, see Creating a bucket. 2. Create the Firehose delivery stream. For more information, see Creating a Firehose stream. 3. Create an IAM role that enables CloudWatch to write to the Firehose delivery stream. For more information about the contents of this role, see Trust between CloudWatch and Firehose. 4. Use the aws cloudwatch put-metric-stream CLI command or the PutMetricStream API to create the CloudWatch metric stream. AWS CloudFormation You can use AWS CloudFormation to set up a metric stream. For more information, see AWS::CloudWatch::MetricStream. To use AWS CloudFormation to create a metric stream 1. If you're streaming to Amazon S3, first create the bucket. For |
acw-ug-068 | acw-ug.pdf | 68 | Create the Firehose delivery stream. For more information, see Creating a Firehose stream. 3. Create an IAM role that enables CloudWatch to write to the Firehose delivery stream. For more information about the contents of this role, see Trust between CloudWatch and Firehose. 4. Use the aws cloudwatch put-metric-stream CLI command or the PutMetricStream API to create the CloudWatch metric stream. AWS CloudFormation You can use AWS CloudFormation to set up a metric stream. For more information, see AWS::CloudWatch::MetricStream. To use AWS CloudFormation to create a metric stream 1. If you're streaming to Amazon S3, first create the bucket. For more information, see Creating a bucket. 2. Create the Firehose delivery stream. For more information, see Creating a Firehose stream. 3. Create an IAM role that enables CloudWatch to write to the Firehose delivery stream. For more information about the contents of this role, see Trust between CloudWatch and Firehose. 4. Create the stream in AWS CloudFormation. For more information, see AWS::CloudWatch::MetricStream. AWS Cloud Development Kit (AWS CDK) You can use AWS Cloud Development Kit (AWS CDK) to set up a metric stream. To use the AWS CDK to create a metric stream 1. If you're streaming to Amazon S3, first create the bucket. For more information, see Creating a bucket. 2. Create the Firehose delivery stream. For more information, see Creating an Amazon Data Firehose Delivery Stream. 3. Create an IAM role that enables CloudWatch to write to the Firehose delivery stream. For more information about the contents of this role, see Trust between CloudWatch and Firehose. Set up a metric stream 167 Amazon CloudWatch User Guide 4. Create the metric stream. The metric stream resource is available in AWS CDK as a Level 1 (L1) Construct named CfnMetricStream. For more information, see Using L1 constructs. Use Quick Amazon S3 setup The Quick S3 Setup method works well if you want to quickly set up a stream to Amazon S3 and you don't need any formatting transformation beyond the supported JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0 formats. CloudWatch will create all necessary resources including the Firehose delivery stream and the necessary IAM roles. The default format for this option is JSON, but you can change the format while you set up the stream. Alternatively, if you want the final format to be Parquet format or Optimized Row Columnar (ORC), you should instead follow the steps in Custom setup with Firehose. CloudWatch console This section describes how to use the CloudWatch console to set up a metric stream Amazon S3 using Quick S3 setup. To set up a metric stream using Quick S3 setup 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, Streams. Then choose Create metric stream. (Optional) If you are signed in to an account that is set up as a monitoring account in CloudWatch cross-account observability, you can choose whether to include metrics from linked source accounts in this metric stream. To include metrics from source accounts, choose Include source account metrics. 4. Choose Quick S3 setup. CloudWatch will create all necessary resources including the Firehose delivery stream and the necessary IAM roles. The default format for this option is JSON, but you can change the format later in this procedure. 5. 6. (Optional) Choose Select existing resources to use an existing S3 bucket or existing IAM roles instead of having CloudWatch create new ones for you. (Optional) To change the output format from the default format for your scenario, choose Change output format. The supported formats are JSON, OpenTelemetry 1.0.0, and OpenTelemetry 0.7.0. 7. For Metrics to be streamed, choose either All metrics or Select metrics. If you choose All metrics, all metrics from this account will be included in the stream. Set up a metric stream 168 Amazon CloudWatch User Guide Consider carefully whether to stream all metrics, because the more metrics that you stream the higher your metric stream charges will be. If you choose Select metrics, do one of the following: • • To stream most metric namespaces, choose Exclude and select the namespaces or metrics to exclude. When you specify a namespace in Exclude, you can optionally select some specific metrics from that namespace to exclude. If you choose to exclude a namespace but don't then select metrics in that namespace, all metrics from that namespace are excluded. To include only a few metric namespaces or metrics in the metric stream, choose Include and then select the namespaces or metrics to include. If you choose to include a namespace but don't then select metrics in that namespace, all metrics from that namespace are included. 8. (Optional) To stream additional statistics for some of these metrics beyond Minimum, Maximum, SampleCount, and Sum, choose Add additional statistics. Either choose Add recommended metrics to add some commonly used |
acw-ug-069 | acw-ug.pdf | 69 | exclude. If you choose to exclude a namespace but don't then select metrics in that namespace, all metrics from that namespace are excluded. To include only a few metric namespaces or metrics in the metric stream, choose Include and then select the namespaces or metrics to include. If you choose to include a namespace but don't then select metrics in that namespace, all metrics from that namespace are included. 8. (Optional) To stream additional statistics for some of these metrics beyond Minimum, Maximum, SampleCount, and Sum, choose Add additional statistics. Either choose Add recommended metrics to add some commonly used statistics, or manually select the namespace and metric name to stream additional statistics for. Next, select the additional statistics to stream. To then choose another group of metrics to stream a different set of additional statistics for, choose Add additional statistics. Each metric can include as many as 20 additional statistics, and as many as 100 metrics within a metric stream can include additional statistics. Streaming additional statistics incurs more charges. For more information, see Statistics that can be streamed. For definitions of the additional statistics, see CloudWatch statistics definitions. 9. (Optional) Customize the name of the new metric stream under Metric stream name. 10. Choose Create metric stream. Quick partner setup CloudWatch provides a quick setup experience for the following third-party partners. To use this workflow, you need to provide only a destination URL and API key for your destination. CloudWatch handles the rest of setup including creating the Firehose delivery stream and the necessary IAM roles. Set up a metric stream 169 Amazon CloudWatch Important User Guide Before you use quick partner setup to create a metric stream, we strongly recommend that you read that partner's documentation, linked in the following list. • Datadog • Dynatrace • Elastic • New Relic • Splunk Observability Cloud • SumoLogic When you set up a metric stream to one of these partners, the stream is created with some default settings, as listed in the following sections. Topics • Set up a metric stream using quick partner setup • Datadog stream defaults • Dynatrace stream defaults • Elastic stream defaults • New Relic stream defaults • Splunk Observability Cloud stream defaults • Sumo Logic stream defaults Set up a metric stream using quick partner setup CloudWatch provides a quick setup option for some third-party partners. Before you start the steps in this section, you must have certain information for the partner. This information might include a destination URL and/or an API key for your partner destination. You should also read the documentation at the partner's website linked in the previous section, and the defaults for that partner listed in the following sections. Set up a metric stream 170 Amazon CloudWatch User Guide To stream to a third-party destination not supported by quick setup, you can follow the instructions in Follow the instructions in Custom setup with Firehose to set up a stream using Firehose, and then send those metrics from Firehose to the final destination. To use quick partner setup to create a metric stream to third-party provider 1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/. 2. 3. In the navigation pane, choose Metrics, Streams. Then choose Create metric stream. (Optional) If you are signed in to an account that is set up as a monitoring account in CloudWatch cross-account observability, you can choose whether to include metrics from linked source accounts in this metric stream. To include metrics from source accounts, choose Include source account metrics. 4. Choose Quick Amazon Web Services partner setup 5. 6. 7. Select the name of the partner that you want to stream metrics to. For Endpoint URL, enter the destination URL. For Access Key or API Key, enter the access key for the partner. Not all partners require an access key. 8. For Metrics to be streamed, choose either All metrics or Select metrics. If you choose All metrics, all metrics from this account will be included in the stream. Consider carefully whether to stream all metrics, because the more metrics that you stream the higher your metric stream charges will be. If you choose Select metrics, do one of the following: • • To stream most metric namespaces, choose Exclude and select the namespaces or metrics to exclude. When you specify a namespace in Exclude, you can optionally select some specific metrics from that namespace to exclude. If you choose to exclude a namespace but don't then select metrics in that namespace, all metrics from that namespace are excluded. To include only a few metric namespaces or metrics in the metric stream, choose Include and then select the namespaces or metrics to include. If you choose to include a namespace but don't then select metrics in that namespace, all metrics from that namespace are included. |
acw-ug-070 | acw-ug.pdf | 70 | most metric namespaces, choose Exclude and select the namespaces or metrics to exclude. When you specify a namespace in Exclude, you can optionally select some specific metrics from that namespace to exclude. If you choose to exclude a namespace but don't then select metrics in that namespace, all metrics from that namespace are excluded. To include only a few metric namespaces or metrics in the metric stream, choose Include and then select the namespaces or metrics to include. If you choose to include a namespace but don't then select metrics in that namespace, all metrics from that namespace are included. 9. (Optional) To stream additional statistics for some of these metrics beyond Minimum, Maximum, SampleCount, and Sum, choose Add additional statistics. Either choose Add Set up a metric stream 171 Amazon CloudWatch User Guide recommended metrics to add some commonly used statistics, or manually select the namespace and metric name to stream additional statistics for. Next, select the additional statistics to stream. To then choose another group of metrics to stream a different set of additional statistics for, choose Add additional statistics. Each metric can include as many as 20 additional statistics, and as many as 100 metrics within a metric stream can include additional statistics. Streaming additional statistics incurs more charges. For more information, see Statistics that can be streamed. For definitions of the additional statistics, see CloudWatch statistics definitions. 10. (Optional) Customize the name of the new metric stream under Metric stream name. 11. Choose Create metric stream. Datadog stream defaults Quick partner setup streams to Datadog use the following defaults: • Output format: OpenTelemetry 0.7.0 • Firehose stream content encoding GZIP • Firehose stream buffering options Interval of 60 seconds, size of 4 MBs • Firehose stream retry option Duration of 60 seconds When you use quick partner setup to create a metric stream to Datadog and you stream certain metrics, by default those metrics include some additional statistics. Streaming additional statistics can incur additional charges. For more information about statistics and their charges, see Statistics that can be streamed. The following list shows the metrics that have additional statistics streamed by default, if you choose to stream those metrics. You can choose to de-select these additional statistics before you start the stream. • Duration in AWS/Lambda: p50, p80, p95, p99, p99.9 • PostRuntimeExtensionDuration in AWS/Lambda: p50, p99 • FirstByteLatency and TotalRequestLatencyin AWS/S3: p50, p90, p95, p99, p99.9 Set up a metric stream 172 Amazon CloudWatch User Guide • ResponseLatency in AWS/Polly and TargetResponseTime in AWS/ApplicationELB: p50, p90, p95, p99 • Latency and IntegrationLatency in AWS/ApiGateway: p90, p95, p99 • Latency and TargetResponseTime in AWS/ELB: p95, p99 • RequestLatency in AWS/AppRunner: p50, p95, p99 • ActivityTime, ExecutionTime, LambdaFunctionRunTime, LambdaFunctionScheduleTime, LambdaFunctionTime, ActivityRunTime, and ActivityScheduleTime in AWS/States: p95, p99 • EncoderBitRate, ConfiguredBitRate, and ConfiguredBitRateAvailable in AWS/ MediaLive: p90 • Latency in AWS/AppSync: p90 Dynatrace stream defaults Quick partner setup streams to Dynatrace use the following defaults: • Output format: OpenTelemetry 0.7.0 • Firehose stream content encoding GZIP • Firehose stream buffering options Interval of 60 seconds, size of 5 MBs • Firehose stream retry option Duration of 600 seconds Elastic stream defaults Quick partner setup streams to Elastic use the following defaults: • Output format: OpenTelemetry 1.0.0 • Firehose stream content encoding GZIP • Firehose stream buffering options Interval of 60 seconds, size of 1 MB • Firehose stream retry option Duration of 60 seconds New Relic stream defaults Quick partner setup streams to New Relic use the following defaults: • Output format: OpenTelemetry 0.7.0 Set up a metric stream 173 Amazon CloudWatch User Guide • Firehose stream content encoding GZIP • Firehose stream buffering options Interval of 60 seconds, size of 1 MB • Firehose stream retry option Duration of 60 seconds Splunk Observability Cloud stream defaults Quick partner setup streams to Splunk Observability Cloud use the following defaults: • Output format: OpenTelemetry 1.0.0 • Firehose stream content encoding GZIP • Firehose stream buffering options Interval of 60 seconds, size of 1 MB • Firehose stream retry option Duration of 300 seconds Sumo Logic stream defaults Quick partner setup streams to Sumo Logic use the following defaults: • Output format: OpenTelemetry 0.7.0 • Firehose stream content encoding GZIP • 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.