AWS IoT Events 使用 Amazon CloudWatch 監控 - AWS IoT Events

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

AWS IoT Events 使用 Amazon CloudWatch 監控

當您開發或偵錯 AWS IoT Events 偵測器模型時,您需要知道 AWS IoT Events 正在做什麼,以及它遇到的任何錯誤。Amazon CloudWatch AWS 會即時監控您的 AWS 資源和您在 上執行的應用程式。透過 CloudWatch,您可以全面了解資源使用、應用程式效能和運作狀態。 在開發 AWS IoT Events 偵測器模型時啟用 Amazon CloudWatch 記錄 提供如何為 啟用 CloudWatch 記錄的相關資訊 AWS IoT Events。若要產生類似如下所示的日誌,您必須將詳細程度設定為「偵錯」,並提供一或多個偵錯目標,即偵測器模型名稱和選用的 KeyValue

下列範例顯示 產生的 CloudWatch DEBUG 層級日誌項目 AWS IoT Events。

{ "timestamp": "2019-03-15T15:56:29.412Z", "level": "DEBUG", "logMessage": "Summary of message evaluation", "context": "MessageEvaluation", "status": "Success", "messageId": "SensorAggregate_2th846h", "keyValue": "boiler_1", "detectorModelName": "BoilerAlarmDetector", "initialState": "high_temp_alarm", "initialVariables": { "high_temp_count": 1, "high_pressure_count": 1 }, "finalState": "no_alarm", "finalVariables": { "high_temp_count": 0, "high_pressure_count": 0 }, "message": "{ \"temp\": 34.9, \"pressure\": 84.5}", "messageType": "CUSTOMER_MESSAGE", "conditionEvaluationResults": [ { "result": "True", "eventName": "alarm_cleared", "state": "high_temp_alarm", "lifeCycle": "OnInput", "hasTransition": true }, { "result": "Skipped", "eventName": "alarm_escalated", "state": "high_temp_alarm", "lifeCycle": "OnInput", "hasTransition": true, "resultDetails": "Skipped due to transition from alarm_cleared event" }, { "result": "True", "eventName": "should_recall_technician", "state": "no_alarm", "lifeCycle": "OnEnter", "hasTransition": true } ] }