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

使用 Amazon CloudWatch 进行监控

当您开发或调试 AWS IoT Events 检测器型号,您需要了解 AWS IoT Events 正在执行,并且遇到任何错误。 Amazon CloudWatch 监控您的 Amazon Web Services (人AWS)资源和运行的应用程序 AWS 实时。有 CloudWatch,您便可在系统范围内查看资源使用情况、应用程序性能和操作运行状况。 启用 Amazon CloudWatch 在开发 AWS IoT Events 检测器型号 了解如何启用 CloudWatch 记录 AWS IoT Events. 要生成如下所示的日志,您必须设置 威力程度 到“调试”,并提供一个或多个 调试目标 这是一种 检测器型号名称 以及可选的 键值.

以下示例显示了 CloudWatch 由生成的调试级别日志条目 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 } ] }