Which service would you use to send alerts based on Amazon CloudWatch alarms?
In the medical field, cardiologists rely on heart monitoring devices to capture patient baselines and trends that enable them to predict and treat heart disease and defects. Similarly, in the contact center field, the ability to monitor and detect anomalies is essential in maintaining a healthy contact center environment. With Amazon Connect and Amazon CloudWatch you can monitor contact center health metrics real time and trigger alerts via Amazon Simple Notification Service (SNS) to send notifications via email, SMS, or AWS Chatbot for Slack, enabling teams to take action on anomalies detected. Show
Email, SMS, and Slack are common communication channels businesses use in day-to-day operations. This post includes instructions using AWS CloudFormation to build a CloudWatch dashboard, alarms, and notifications via Amazon SNS for email or SMS or an Amazon chatbot for Slack. Overview of solutionThe following architecture diagram depicts an Amazon Connect powered call center sending performance updates as metric messages to CloudWatch. CloudWatch receives these messages and is configured to display the metrics on a dashboard administrators can monitor. CloudWatch is also configured with alarms that can notify an administrator when triggered. Notifications are powered using Amazon SNS for email, SMS messages, or Amazon Chatbot for Slack. WalkthroughThe high-level steps that we will walk through in this post are as follows:
PrerequisitesFor this walkthrough, it is assumed you have the following:
Create AWS Chatbot Client and connect to Slack Workspace (For Slack option only)To use Slack as a channel for CloudWatch alarm notifications, setup an AWS Chatbot client via the following steps:
Note: the AWS CloudFormation stack will configure a slack channel for the Chatbot client Launch AWS CloudFormation stackThis post assumes you have already deployed an Amazon Connect instance. To build and configure the other parts of the architecture, deploy using CloudFormation as described:
It will take a minute or two to finalize deployment. If successful, the status will change to CREATE_COMPLETE. If there are issues, double check the parameter values entered and try again. On completion of stack creation, it will send a SNS topic subscription confirmation email to the email address you provided in the SNSEndpoint. Check your email inbox and confirm subscription so that you can receive Amazon Connect metrics alarm notification emails. Review the dashboard and optionally adjust metricsA new CloudWatch dashboard has been created to track all Amazon Connect metrics sent to CloudWatch
Most metrics from Amazon Connect are published to CloudWatch once every minute. By displaying these on a graph, this can help reveal overall trends and patterns. If the Amazon Connect instance being monitored is new, the metrics will be blank until calls are placed. Configuration for the graphs has been included in the CloudFormation. However, these can be modified after deployment if desired. You can rename, edit, or delete widgets to customize your dashboard, if you prefer, see Using Amazon CloudWatch Dashboards Make sure the statistic type makes sense for your purposes. For example, changing MissedCalls to Average won’t display how many missed calls occurred, just an average across the period and produce incorrect values in the graph. Note the ToInstancePacketLossRate reports a value every 10 seconds between 0.0 and 1.0. Therefore, make sure you’re using correct units when looking for packet loss values (0.05 equals 5%). Even though it reports every 10 seconds, Amazon Connect still reports every minute so make sure to set the period to 60 seconds to see data. All metric definitions can be found here CloudWatch Metrics for Your Amazon Connect Instance Understanding alarmsRemain in the CloudWatch console and navigate to the configured alarms.
Note, because it wasn’t defined in the CloudFormation Template, alarm names will be automatically named and include the CloudFormation resource type as part of the name. The state of these alarms is likely Insufficient data, this is normal. CloudWatch classifies new alarms with this status until sufficient data is received. Review alarm configurationTo review the configuration of an alarm:
Notice the alarm is set to trigger whenever MissedCalls is greater or equal to 5 out of 5 datapoints. A datapoint is the time configured within the Period value. In this example, since a period is configured for 60 seconds, 5 periods equal 5 minutes. Therefore, the alarm is configured to trigger if there are 5 or more missed calls every minute within a span of 5 minutes. For more information on how to define these values properly, consult the CloudWatch reference for M and N configuration. CloudWatch metrics can use dimensions as part of their schema. Amazon Connect metrics dimensions are listed in the Amazon Connect CloudWatch Metrics Dimensions section of the documentation. When creating alarms and dashboards, it is vital to include the proper dimension framework else data will not be shown. Understanding alarm notificationsWhen the thresholds of an alarm are exceeded, it will change it to an ALARM state and remain this way until the values return to normal for one period. CloudWatch alarms should be configured with a notification. In this example, an email, SMS, or Slack message will be sent to an individual when alarmed. The details of this message can be found within the Amazon SNS Service.
Note, If electing email for a topic endpoint, you must wait for a confirmation message and follow the instruction in that message before receiving alerts from Amazon SNS. Test and confirm notificationsNow that you have reviewed your CloudWatch dashboard and alerts, let’s test your notifications. In this test, you will generate a missed call alarm by placing a call to your Amazon Connect instance and letting the call ring through to an available agent, putting the agent into a missed call state. The missed calls alarm will activate and you will receive alarm notifications via both email and slack. Note, you will need access to sign in as an agent in your Amazon Connect instance. You will also need a phone number claimed and configured to route to your agent in Amazon Connect.
Cleaning upNote, the Amazon Connect metrics included in this solution are sent automatically to CloudWatch for free. However, if preferred, you can delete the CloudFormation stack to remove the configuration from this post.
ConclusionThis example of building an Amazon Connect dashboard and alarming with CloudWatch is important to consider for production environments. By using Amazon Connect with CloudWatch metrics, it is easy to create dashboards to monitor the activity across singular or multiple Amazon Connect instances. With Amazon SNS or AWS Chatbot with Slack, you can create a notification strategy to respond to alarms that are created with Cloudwatch. Lastly, the entire architecture can be deployed with a single click by leveraging CloudFormation templates. With this visibility and awareness, a system administrator is well equipped to be proactive and ensure a healthy Amazon Connect environment in a production setting. Which service can you use to set alarms to monitor AWS resources?CloudWatch enables you to monitor your complete stack (applications, infrastructure, network, and services) and use alarms, logs, and events data to take automated actions and reduce mean time to resolution (MTTR). This frees up important resources and allows you to focus on building applications and business value.
What is the AWS service for sending out alerts and alarms based on specific events in an environment?Amazon CloudWatch Events delivers a near real-time stream of system events that describe changes in Amazon Web Services (AWS) resources. Using simple rules that you can quickly set up, you can match events and route them to one or more target functions or streams.
Can CloudWatch send alerts?You can configure CloudWatch Logs to send a notification whenever an alarm is triggered for CloudTrail. Doing so enables you to respond quickly to critical operational events captured in CloudTrail events and detected by CloudWatch Logs. CloudWatch uses Amazon Simple Notification Service (SNS) to send email.
What is the name of Amazon's logging system CloudWatch?You can collect Amazon CloudWatch Logs from multiple accounts and AWS Regions. This solution uses Amazon OpenSearch Service and Kibana, an analytics and visualization platform that is integrated with Amazon OpenSearch Service, that results in a unified view of all the log events.
|