

# OPS08-BP06 在工作負載結果有風險時發出提醒
<a name="ops_workload_health_workload_outcome_alerts"></a>

 當工作負載結果有風險時發出提醒，以便您可以在必要時做出適當的回應。 

 理想情況下，您先前已識別可對其發出警示的指標閾值，或已識別可用來觸發自動回應的事件。 

 在 AWS 上，您可以使用 [Amazon CloudWatch Synthetics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html) 建立 Canary 指令碼，來監控您的端點和 API，方法為執行與客戶相同的動作。產生的遙測和 [取得的洞見](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Details.html) 可讓您在客戶受到影響之前識別問題。 

 您也可以使用 [CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) ，透過專門打造的查詢語言，以互動的方式搜尋並分析日誌資料。CloudWatch Logs Insights 會自動 [探索 AWS 服務日誌中的欄位，](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html) 以及 JSON 中的自訂日誌事件。它可以隨日誌量和查詢複雜性進行擴展，並在幾秒鐘內提供答案，以協助您搜尋事件的影響因素。 

 **常用的反模式：** 
+  您沒有網路連線能力。沒有人注意到。沒有人嘗試找出原因，或採取動作來恢復連線。 
+  套用修補程式之後，您的持久性執行個體不可用，從而中斷使用者。您的使用者已開啟支援案例。沒有人收到通知。沒有人採取動作。 

 **建立此最佳實務的優勢：** 透過識別業務成果已產生風險，並提醒採取動作，您就有機會防止或緩解事件的影響。 

 **若未建立此最佳實務，暴露的風險等級為：** 中 

## 實作指引
<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 Synthetics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html) 
+  [CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.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) 
+  [什麼是 Amazon CloudWatch Events？](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html) 