

亚马逊 Monitron 不再向新客户开放。现有客户可以继续正常使用该服务。如需了解与 Amazon Monitron 类似的功能，请参阅我们的[博客文章](https://aws.amazon.com/blogs/machine-learning/maintain-access-and-consider-alternatives-for-amazon-monitron)。

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

# 使用 Amazon CloudWatch 日志进行监控
<a name="data-export-cloudwatch-logs"></a>

您可以使用亚马逊日志监控 Amazon Monitron 的实时数据导出。 CloudWatch 当测量结果无法导出时，Amazon Monitron 会将日志事件发送到您的 CloudWatch 日志。您还可以针对错误日志设置指标筛选条件，以生成指标和设置警报。警报可以监测特定阈值，并在达到相应阈值时发送通知或执行操作。有关更多信息，请参阅[《 CloudWatch 用户指南》](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html)。

Amazon Monitron 将日志事件发送到/ aws/monitron/data-export/ {HASH\_ID} 日志组。

日志事件采用以下 JSON 格式：

```
{ 
    "assetDisplayName": "string", 
    "destination": "string", 
    "errorCode": "string", 
    "errorMessage": "string", 
    "eventId": "string", 
    "positionDisplayName": "string", 
    "projectDisplayName": "string", 
    "projectName": "string", 
    "sensorId": "string", 
    "siteDisplayName": "string", 
    "timestamp": "string"
}
```

assetDisplayName  
+ 应用程序中显示的资产名称
+ 类型：字符串

destination  
+ Kinesis 数据流的 ARN
+ 类型：字符串
+ 模式：arn: aws: kinesis: {{REGION}}: {{AWS\_ACCOUNT\_ID}}: stream/ {{STREAM\_NAME}}

errorCode  
+ 错误代码
+ 类型：字符串
+ 有效值：`INTERNAL_SEVER_ERROR | KINESIS_RESOURCE_NOT_FOUND | KINESIS_PROVISIONED_THROUGHPUT_EXCEEDED | KMS_ACCESS_DENIED | KMS_NOT_FOUND | KMS_DISABLED | KMS_INVALID_STATE | KMS_THROTTLING`

errorMessage  
+ 详细错误消息
+ 类型：字符串

eventId  
+ 与每次测量数据导出对应的唯一事件 ID
+ 类型：字符串

positionDisplayName  
+ 应用程序中显示的传感器位置名称
+ 类型：字符串

sensorId  
+ 发出测量数据的传感器的物理 ID
+ 类型：字符串

siteDisplayName  
+ 应用程序中显示的站点名称
+ 类型：字符串

timestamp  
+ Amazon Monitron 服务接收测量数据时的时间戳（UTC 格式）
+ 类型：字符串
+ 图案： yyyy-mm-ddHH: mm: ss.sss