You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/aws/services/cloudwatch.md
+44-48Lines changed: 44 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,18 @@
1
1
---
2
2
title: "CloudWatch"
3
-
linkTitle: "CloudWatch"
4
3
description: Get started with AWS CloudWatch on LocalStack
5
4
persistence: supported
6
5
tags: ["Free"]
7
6
---
8
7
8
+
## Introduction
9
+
9
10
CloudWatch is a comprehensive monitoring and observability service that Amazon Web Services (AWS) provides.
10
11
It allows you to collect and track metrics, collect and monitor log files, and set alarms.
11
12
CloudWatch provides valuable insights into your AWS resources, applications, and services, enabling you to troubleshoot issues, optimize performance, and make informed decisions.
12
13
13
14
LocalStack allows you to use CloudWatch APIs on your local machine to create and manage CloudWatch resources, such as custom metrics, alarms, and log groups, for local development and testing purposes.
14
-
The supported APIs are available on our [API coverage page]({{< ref "coverage_cloudwatch" >}}), which provides information on the extent of CloudWatch's integration with LocalStack.
15
-
16
-
{{< callout >}}
17
-
We have introduced an all-new LocalStack-native [CloudWatch provider]({{< ref "/user-guide/aws/cloudwatch" >}}) and recently made this one the default.
18
-
19
-
With the new provider we have migrated from storing data in Python objects within the Moto backend to a more robust system.
20
-
21
-
Now, metrics are efficiently stored in SQLite, and alarm resources are managed using LocalStack stores.
22
-
23
-
- Various enhancements have been made to attain greater feature parity with AWS.
24
-
- The provider is engineered to ensure thread safety, facilitating smooth concurrent operations.
25
-
- There’s a significant improvement in the integrity and durability of data.
26
-
- The new provider allows for more efficient data retrieval.
27
-
28
-
Currently, it is still possible to switch back to the old provider using `PROVIDER_OVERRIDE_CLOUDWATCH=v1` in your LocalStack configuration.
29
-
{{< /callout >}}
15
+
The supported APIs are available on our [API coverage page](), which provides information on the extent of CloudWatch's integration with LocalStack.
30
16
31
17
## Getting started
32
18
@@ -38,13 +24,13 @@ You can get the name for your Lambda Functions using the [`ListFunctions`](https
38
24
Fetch the Log Groups using the [`DescribeLogGroups`](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html) API.
39
25
Run the following command to get the Log Group name:
40
26
41
-
{{< command >}}
42
-
$ awslocal logs describe-log-groups
43
-
{{< / command >}}
27
+
```bash
28
+
awslocal logs describe-log-groups
29
+
```
44
30
45
31
The output should look similar to the following:
46
32
47
-
```sh
33
+
```bash
48
34
{
49
35
"logGroups": [
50
36
{
@@ -68,14 +54,14 @@ The output should look similar to the following:
68
54
Get the log streams for the Log Group using the [`DescribeLogStreams`](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogStreams.html) API.
69
55
Run the following command to get the Log Stream name:
@@ -95,14 +81,14 @@ The output should look similar to the following:
95
81
You can now fetch the log events using the [`GetLogEvents`](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html) API.
@@ -126,9 +112,9 @@ The output should look similar to the following:
126
112
}
127
113
```
128
114
129
-
{{< callout "tip" >}}
115
+
:::note
130
116
You can use [filters](https://docs.aws.amazon.com/cli/latest/reference/logs/filter-log-events.html) or [queries](https://docs.aws.amazon.com/cli/latest/reference/logs/get-query-results.html) with a licensed LocalStack edition to refine your results.
131
-
{{< /callout >}}
117
+
:::
132
118
133
119
## Metric Alarms
134
120
@@ -145,8 +131,8 @@ With metric alarms, you can create customized thresholds and define actions base
145
131
146
132
To get started with creating an alarm in LocalStack using the `awslocal` integration, use the following command:
Within a few seconds, the alarm state should change to **ALARM**, and eventually, it will go back to **OK** as we configured it to treat missing data points as `not breaching`.
176
162
This allows you to observe how the alarm behaves in response to the provided data.
@@ -184,8 +170,8 @@ Currently, only SNS Topics are supported as the target for these actions, and it
184
170
Here's an example demonstrating how to set up an alarm that sends a message to the specified topic when entering the **ALARM** state.
185
171
Make sure to replace `<topic-arn>` with the valid ARN of an existing SNS topic.
By executing this command, you'll create an alarm named `my-alarm` that monitors the `Orders` metric in the `test` namespace.
202
188
If the metric value exceeds the threshold of 50 (using the `GreaterThanThreshold` operator) during a single evaluation period of 300 seconds, the alarm will trigger the specified action on the provided SNS topic.
203
189
204
-
{{< callout "warning" >}}
190
+
:::danger
205
191
Please be aware of the following known limitations in LocalStack:
206
192
- Anomaly detection and extended statistics are not supported.
207
193
- The `unit` values specified in the alarm are ignored.
208
194
- Composite alarms are not evaluated.
209
195
- Metric streams are not supported.
210
-
{{< /callout >}}
196
+
:::
197
+
198
+
## Current Limitations
199
+
200
+
The following CloudWatch Metrics are not supported:
201
+
202
+
- Anomaly detection
203
+
- Metric streams
204
+
- Extended statistics
205
+
206
+
In addition, the `unit` values specified in the alarm are ignored, and Composite alarms are not evaluated.
211
207
212
-
## Supported Service Integrations with CloudWatch Metrics
208
+
## Supported Service Integrations
213
209
214
210
LocalStack supports the following AWS services for integration with CloudWatch metrics:
215
211
@@ -223,9 +219,9 @@ You can access the Resource Browser by opening the LocalStack Web Application in
223
219
224
220
The Resource Browser allows you to perform the following actions:
0 commit comments