在裝置上安裝 CloudWatch 代理程式 - Amazon Kinesis Video Streams

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

在裝置上安裝 CloudWatch 代理程式

注意

請注意CloudWatch配額

請依照下列程序安裝並設定 CloudWatch 代理程式,以自動將 Amazon Kinesis Video Streams Edge Agent 產生的日誌上傳至 CloudWatch。此為選用步驟。

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

提示組態時,選取下列其中一個組態。

重要

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

使用的檔案路徑假設您正在從位置執行 Amazon Kinesis Video Streams Edge Agent: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" } ] } } } }