Saturday, July 20, 2024
No menu items!
HomeArtificial Intelligence and Machine LearningEasily customize your notifications while using Amazon Lookout for Metrics

Easily customize your notifications while using Amazon Lookout for Metrics

We are excited to announce that you can now add filters to alerts and also edit existing alerts while using Amazon Lookout for Metrics. With this launch, you can add filters to your alerts configuration to only get notifications for anomalies that matter the most to you. You can also modify existing alerts as per your needs for notification as anomalies evolve.

Lookout for Metrics uses machine learning (ML) to automatically monitor the metrics that are most important to businesses with greater speed and accuracy. The service also makes it easier to diagnose the root cause of anomalies like unexpected dips in revenue, high rates of abandoned shopping carts, spikes in payment transaction failures, increases in new user signups, and many more. Lookout for Metrics goes beyond simple anomaly detection. It allows developers to set up autonomous monitoring for important metrics to detect anomalies and identify their root cause in a matter of few clicks, using the same technology used by Amazon internally to detect anomalies in its metrics—all with no ML experience required.

Alert is an optional feature that allows you to set up notifications on anomalies in the datasets, which are sent through Amazon Simple Notification Service (Amazon SNS) and AWS Lambda functions. Previously, when you set up an alert, you were notified on all detected anomalies above the severity score you selected, which made it challenging to quickly identify the most relevant anomalies to your business. Now, by implementing filters and edits in the alert system, different business units within your organization are able to specify the types of alerts they receive. Your developers can benefit from this feature by being able to receive alerts on anomalies that are related to the development of their service, while your business analysts and business managers can track anomalies related to the status of their business, such as a location that is underperforming. For example, you may set up an alert to get notified when there is a spike or drop in your revenue. But you may only be interested in a specific store location and in a particular product. The filtering capability allows you to get alerted only when a revenue anomaly fits the criteria you have set.

Solution overview

In this post, we demonstrate how to create Alert with filters and how the configured filters publish alerts only for anomalies matching the filter criteria. The alert filters are based on metrics and dimensions that are present in the dataset definition for the anomaly detector. The solution enables you to use alert filters to get targeted notifications for anomalies detected in your data. The following diagram illustrates the solution architecture.

Provision resources with AWS CloudFormation

You can use the provided AWS CloudFormation stack to set up resources for the walkthrough. It contains resources to continuously generate live data and publish them to Amazon S3, create a detector (named TestAlertFilters) and add a dataset (named AlertFiltersDataset) to the detector. Complete the following steps:

Choose Launch Stack:

Choose Next.
Enter a stack name (for example, L4MAlertFiltersStack).
Enter the values for the detector (TestAlertFilters) and dataset (AlertFiltersDataset).
Choose Next.
Leave the settings for Configure stack options at their defaults and choose Next.
Select the acknowledgement check box and choose Create stack.

Activate the detector created by CFN template

To set up your detector, complete the following steps:

On the Lookout for Metrics console, choose Detectors in the navigation pane.

Select the detector TestAlertFilters and choose View details.

To activate the detector, you can either choose Activate at the top or choose Activate detector under How it works.

Choose Activate to confirm if you want to activate the detector for continuous detection.

A confirmation message shows that the detector is activating. Activation can take up to 1 hour to complete. In the meantime, we can proceed with alert configuration.

Configure your alert

We now configure an alert to get notifications for anomalies detected by the detector. Alert filters are optional configurations, and you can select up to 5 measures and 5 dimensions while adding filters. In this post, we walk through creating an alert with filters. Complete the following steps:

On your detector details page, choose Add alerts.
Confirm your alert name.
Lookout for Metrics populates the configuration fields with the metrics and dimensions supplied during dataset creation.In this release, the Severity score field is optional, which previously was a required field. By default, we start with severity score of 70, which you can change or remove.
To add a measure, choose Add criteria and choose Measure.

For Measure EQUALS, choose the revenue measure.

Choose Add criteria again and choose Dimension.

You can choose up to 5 dimension filters. For this post, we configure two.
For Dimension, choose the marketplace dimension.

For Equals, add the values US and CA.

Add category as your second dimension with the values fashion and jewellery.
For Severity score, enter 20.

For Channel, choose Amazon SNS.

Choose your SNS topic (for this post, we use the SNS topic to which we already subscribed our email to receive the alert notifications).
Choose your format (for this post, we choose Long Text).
Under Service access, select Use an existing service role and choose your role.
Choose Add alert.

A message appears when the alert is created successfully.
Select the alert and choose View details.

You can review the alert filters and other details. The Filter criteria explains how the configured filters are used to filter anomalies before publishing alert notifications.

If you want to modify the alert configuration, select the alert on the Alerts page and choose Edit.

Alternatively, you can open the alert details page and choose Edit.

You’re redirected to the Edit page, where you can modify the alert configuration as required. You can modify the same configurations you set when you created the alert, but you can’t change the alert name while editing.

Review and analyze the results

When Lookout for Metrics detects anomalies in your data, it sends a notification if alerts were configured on that detector. If the anomaly group details match the filter criteria (measure filter, dimension filter, and severity score) of the alert, a notification is published.

For this example, we created two alerts on the detector, testAlertWithNoFilters and testRevenueForFashionOrJewelleryInUSOrCA, and injected anomalies in our data. We also enabled email subscription on the SNS topic used for alert notification publishing. The following screenshots show the details for each alert.

The following is an example of an anomaly notification for testRevenueForFashionOrJewelleryInUSOrCA:

“Type” : “Notification”,
“MessageId” : “0b0a7bfe-d029-5f4f-b706-20f644793c3d”,
“TopicArn” : “arn:aws:sns:us-west-2:488415817882:filterAlertsDemoTopic”,
“Message” : “[Amazon LookoutForMetrics] The anomaly detector TestAlertFilters detected
an anomaly in revenue with a severity score of 77.3 on May 25, 2022 at 8:05 PM.
nAnomalous graphs were detected for the following:n
nrevenue for: jewellery, thirdParty, CA, regular, priorityn
nrevenue for: electronics, self, MX, premium, overnightn
nrevenue for: electronics, self, US, regular, overnightn
nTo view the anomaly, visit the Lookout for Metrics console at:
nTo modify settings for this alert:”,
“Timestamp” : “2022-05-25T20:31:12.330Z”,
“SignatureVersion” : “1”,
“Signature” : “pFDZj3TwLrL9rqjkRiVgbWjcrPhxz5PDV485d6NroLXWhrviX7sUEQqOIL5j8YYd0SFBjFEkrZKZ27RSbd+33sRhJ52mmd1eR23cZQP68+iIVdpeWubcPgGnqxoOa3APE1WZr4SmVK/bgJAjX1RXn0rKZvPzwDkxPD2fZB4gnbqPJ8GBw/1dxU5qfJzRpkqc87d1gpvQIwMpb5uUROuPZEQVyaR/By0BTsflkE2Sz2mOeZQkMaXz3q9dwX/qDxyR9q6gNviMagGtOLwtb6StN8/PUYlvK9fCBcJnJxg0bdmMtnXiXWdl1O7J50Wqj4Tkl8amph97UlVAnComoe649g==”,
“SigningCertURL” : “”,
“UnsubscribeURL” : “”

The following is an example of an anomaly notification for testAlertWithNoFilters:

“Type” : “Notification”,
“MessageId” : “fcc70263-f2c1-52ed-81ec-596b8c399b67”,
“TopicArn” : “arn:aws:sns:us-west-2:488415817882:filterAlertsDemoTopic”,
“Message” : “[Amazon LookoutForMetrics] The anomaly detector TestAlertFilters detected
an anomaly in revenue with a severity score of 77.59 on May 25, 2022 at 6:35 PM.
nAnomalous graphs were detected for the following:n
nrevenue for: jewellery, self, UK, regular, overnightn
nrevenue for: jewellery, thirdParty, JP, premium, overnightn
nrevenue for: electronics, thirdParty, DE, premium, priorityn
nTo view the anomaly, visit the Lookout for Metrics console at:
nTo modify settings for this alert:”,
“Timestamp” : “2022-05-25T19:00:08.374Z”,
“SignatureVersion” : “1”,
“Signature” : “e4+BHo4eh8wNbfQMaR3L8MWY2wkpqxoxKKrj2h/QROQHvhcnYfucYchjfppgjM8LNIF7Oo4QfuP6qcLj9DlghiMZ80qpzHyAH6vmIDfSjK7Bz23i8rnIMyKJIVRFN8z69YlC9vfsp3MayWyyMJcskeVJ1bzsdkDIeA5gkT1le8yh/9nhbsgwm+bowNjsnl+/sFwk6QZJlplYB27sOqegrm73nH/CrmTe4FcPtekCRysSECwMLKazPJqR1uiGagnWfUeyTptRg9rVQVQJJdmOUwlv8vodR96s52btAegpY4iZZLUJ87vs1PwOwVfTTIHf+pdnwPUuFupzejUEudP7sQ==”,
“SigningCertURL” : “”,
“UnsubscribeURL” : “”

We didn’t receive the notification for this anomaly through the testRevenueForFashionOrJewelleryInUSOrCA alert because the anomaly group details don’t match the filter criteria for dimension marketplace. For our filter criteria on the measure revenue, the dimension marketplace must equal US or CA, and the dimension category must equal fashion or jewellery, with a severity threshold of 20.

Although the anomaly detected matches the filter criteria for the measure, severity score, and category dimension, it doesn’t match the criteria for the marketplace dimension, so the alert wasn’t published.

Based on the notifications we received, we can confirm that Lookout for Metrics detected anomalies and verified the alert filter-based notifications.

Clean up

After you complete the testing, you can delete the CloudFormation stack created by the template. Deletion of stack the cleans up all the resources created for the purpose of this test. To delete the stack, open the AWS CloudFormation console, select the stack L4MAlertFiltersStack, and choose Delete.

Deletion of the stack doesn’t delete the S3 bucket created by the template because it’s not empty; you have to delete it manually.


You can now easily customize your notification experience by adding filters and editing existing alerts to reduce noise and focus on the metrics that matter the most to your business.

To learn more about this capability, see Working with Alerts. You can use this capability in all Regions where Lookout for Metrics is publicly available. For more information about Region availability, see AWS Regional Services.

About the Authors

Alex Kim is a Sr. Product Manager for AWS AI Services. His mission is to deliver AI/ML solutions to all customers who can benefit from it. In his free time, he enjoys all types of sports and discovering new places to eat.

Utkarsh Dubey is a Software Development Engineer in the Lookout for Metrics team. His interests lie in building scalable distributed systems. In his spare time, he enjoys traveling and catching up with friends.

Read MoreAWS Machine Learning Blog



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments