

# OPS08-BP07 在检测到工作负载异常时发出提醒
<a name="ops_workload_health_workload_anomaly_alerts"></a>

 在检测到工作负载异常时发出提醒，从而在必要时做出适当响应。 

 您对一段时间内工作负载指标的分析可能会建立行为模式，您可以对这些模式进行充分量化，以定义事件或发出警报作为响应。 

 经过训练后， [CloudWatch 异常检测](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html) 功能可用于 [对](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Anomaly_Detection_Alarm.html) 检测到的异常发出警报，或将期望值叠加到指标数据 [图表](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph_a_metric.html#create-metric-graph) 上，以进行持续的比较。 

 **常见反模式：** 
+  您零售网站的销量突然急剧增加。没有人发现这一情况。没有人尝试找出导致这种激增的原因。没有人采取措施来让客户在额外负载下仍然保持优质体验。 
+  应用补丁后，您的持久性服务器频繁重启，这会对用户造成影响。通常情况下，服务器最多重启三次。没有人发现这一情况。没有人尝试确定发生这种情况的原因。 

 **建立此最佳实践的好处：** 通过了解工作负载行为的模式，您可以发现意外行为，并在必要时采取措施。 

 **未建立这种最佳实践的情况下暴露的风险等级：** 低 

## 实施指导
<a name="implementation-guidance"></a>
+  在检测到工作负载异常时发出提醒：在检测到工作负载异常时发出提醒，以便您能够根据需要做出适当响应。 
  +  [什么是 Amazon CloudWatch Events？](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html) 
  +  [创建 Amazon CloudWatch 警报](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html) 
  +  [使用 Amazon SNS 通知调用 Lambda 函数](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) 

## 资源
<a name="resources"></a>

 **相关文档：** 
+  [创建 Amazon CloudWatch 警报](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html) 
+  [CloudWatch 异常检测](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html) 
+  [使用 Amazon SNS 通知调用 Lambda 函数](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) 
+  [什么是 Amazon CloudWatch Events？](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html) 