步驟 9:(選擇性) 在裝置上安裝 CloudWatch 代理程式 - Amazon Kinesis Video Streams

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

步驟 9:(選擇性) 在裝置上安裝 CloudWatch 代理程式

注意

請注意CloudWatch配額

依照下列程序安裝並設定 CloudWatch 代理程式,以自動將 Amazon Kinesis Video Streams 邊緣代理程式產生的日誌上傳到 CloudWatch。

如需在裝置上安裝 CloudWatch 代理程式的程序,請參閱 Amazon CloudWatch 使用者指南。

當系統提示您輸入組態時,請選擇下列其中一個模型組態。

重要

下列組態file_path中的假設使用預設記錄輸出位置。

使用的檔案路徑假設您正在從以下位置執行 Amazon Kinesis Video Streams 邊緣代理程式:download-location/kvs-edge-agent/KvsEdgeComponent/artifacts/aws.kinesisvideo.KvsEdgeComponent/version

  • 若要將 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" } ] } } } }