Latest version: 4.3.x
CloudWatch
Setup a CloudWatch connection for Streaming Data Platform alerts and notifications.
Prerequisites
- An AWS account with access to CloudWatch is required
- In order to view the alerts in AWS you need to create an “Event rule”.
- Navigate to “Events” -> “Rules” -> “Create rule”
- Select “Event pattern” and “All events”
- Add a target for “Cloudwatch log group”
- Specify a name for the group (/aws/events/… - any name should work)
- Click “Configure details”
Set up
1. Visit Admin → Connections and click New connection
2. Select CloudWatch
3. Provide a name and configuration
You can also optionally add tags. CloudWatch API-specific information can be found on CloudWatch API Help
Add channel
Next add one or multiple target CloudWatch channels.
1. Visit Admin → Channels and click CloudWatch
2. Setup the configuration options
For example the above will create the cw-devops
channel, that is using the aws connection having as source the lenses.alerts
.
Filter Lenses logs in CloudWatch
To filter out messages produced by Lenses you need to create a query in CloudWatch. Plenty of fields can be used for such filtering. source
could be the best option since this is the only one that allows you not only to pick alerts coming from Lenses, but also from a particular Lenses instance (if you have more than 1 instance of Lenses).
In CloudWatch UI, search for the given source in the Logs screen. According to the documentation of AWS CloudWatch Logs queries , you can use a query such as the following:
fields @timestamp, @message
| filter source = "the source you defined for lenses channel"
| sort @timestamp desc
| limit 20
As mentioned before, there are plenty of fields that can be used in such queries. You can see them after expanding one of the messages in CloudWatch Logs page:
An example
If, for example, you create a rule to send infrastructure notifications to CloudWatch,
then the moment a Broker goes offline, a message will be sent to the cw-devops
channel.
Additional info
Users with the alert permission can create alert rules .