使用 Amazon 监控 CloudWatch - Amazon IoT Events
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用 Amazon 监控 CloudWatch

当你开发或调试时Amazon IoT Events detector model, you need to know what Amazon IoT Events正在执行,以及它遇到的任何错误。亚马逊 CloudWatch 监控您的Amazon Web ServicesAmazon) 资源以及您在中运行的应用程序Amazon实时。与 CloudWatch,可全面地的资源使用、应用程序性能和运行状况。启用Amazon CloudWatch 开发时记录Amazon IoT Events探测器模型包含有关如何启用的信息 CloudWatch 为... 登录Amazon IoT Events. 要生成如下所示的日志,必须设置详细程度“调试” 并提供一个或多个调试目标那是一个探测器型号还有一个可选的KeyValue.

以下示例显示一个 CloudWatch 生成的 DEBUG 级别日志条目Amazon 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 } ] }