在设备上安装 CloudWatch 代理 - Amazon Kinesis Video Streams
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

在设备上安装 CloudWatch 代理

注意

注意配CloudWatch额

按照以下步骤安装和配置 CloudWatch 代理,使其自动将 Amazon Kinesis Video Streams Edge Agent CloudWatch 生成的日志上传到。此为可选步骤。

有关在您的设备上安装 CloudWatch 代理的步骤,请参阅《Amazon CloudWatch 用户指南》。

当系统提示您进行配置时,请选择以下配置之一

重要

以下配置file_path中的假设使用了默认的日志输出位置。

使用的文件路径假设你正在从以下位置download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version运行 Amazon Kinesis Video Streams Edge Agent:。

  • 要将 CloudWatch 代理配置为上传日志并发布设备RAM和CPU指标,请将以下内容粘贴到配置文件中。

    { "agent": { "run_as_user": "ubuntu", "metrics_collection_interval": 60 }, "metrics": { "metrics_collected": { "mem": { "measurement": [ "mem_used_percent" ], "append_dimensions": { "IotThing": "YourIotThingName" } }, "cpu": { "resources": [ "*" ], "measurement": [ "usage_active" ], "totalcpu": true, "append_dimensions": { "IotThing": "YourIotThingName" } } } }, "logs": { "logs_collected": { "files": { "collect_list": [ { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/java_kvs.log", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-java_kvs.log" }, { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/cpp_kvs_edge.log*", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-cpp_kvs_edge.log" }, { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/cpp_kvs_streams.log*", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-cpp_kvs_streams.log" }, { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/cpp_kvssink.log*", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-cpp_kvssink.log" } ] } } } }
  • 要仅上传日志而不收集设备RAM和的日志CPU,请使用以下配置:

    { "logs": { "logs_collected": { "files": { "collect_list": [ { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/java_kvs.log", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-java_kvs.log" }, { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/cpp_kvs_edge.log*", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-cpp_kvs_edge.log" }, { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/cpp_kvs_streams.log*", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-cpp_kvs_streams.log" }, { "file_path": "download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version/log/cpp_kvssink.log*", "log_group_name": "/aws/kinesisvideo/EdgeRuntimeAgent", "log_stream_name": "YourIotThingName-cpp_kvssink.log" } ] } } } }