Amazon ECS 的 Container Insights 性能日志事件 - Amazon CloudWatch
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

Amazon ECS 的 Container Insights 性能日志事件

以下是 Container Insights 从 Amazon ECS 收集的性能日志事件的实例。

这些日志在 CloudWatch Logs 中位于名为 /aws/ecs/containerinsights/CLUSTER_NAME/performance 的日志组中。在该日志组中,每个容器实例都将有一个名为 AgentTelemetry-CONTAINER_INSTANCE_ID 的日志流。

您可以使用查询来查询这些日志,例如使用 { $.Type = "Container" } 来查看所有容器日志事件。

类型:容器

{ "Version":"0", "Type":"Container", "ContainerName":"sleep", "TaskId":"7ac4dfba69214411b4783a3b8189c9ba", "TaskDefinitionFamily":"sleep360", "TaskDefinitionRevision":"1", "ContainerInstanceId":"0d7650e6dec34c1a9200f72098071e8f", "EC2InstanceId":"i-0c470579dbcdbd2f3", "ClusterName":"MyCluster", "Image":"busybox", "ContainerKnownStatus":"RUNNING", "Timestamp":1623963900000, "CpuUtilized":0.0, "CpuReserved":10.0, "MemoryUtilized":0, "MemoryReserved":10, "StorageReadBytes":0, "StorageWriteBytes":0, "NetworkRxBytes":0, "NetworkRxDropped":0, "NetworkRxErrors":0, "NetworkRxPackets":14, "NetworkTxBytes":0, "NetworkTxDropped":0, "NetworkTxErrors":0, "NetworkTxPackets":0 }

类型:任务

{ "Version": "0", "Type": "Task", "TaskId": "7ac4dfba69214411b4783a3b8189c9ba", "TaskDefinitionFamily": "sleep360", "TaskDefinitionRevision": "1", "ContainerInstanceId": "0d7650e6dec34c1a9200f72098071e8f", "EC2InstanceId": "i-0c470579dbcdbd2f3", "ClusterName": "MyCluster", "AccountID": "637146863587", "Region": "us-west-2", "AvailabilityZone": "us-west-2b", "KnownStatus": "RUNNING", "LaunchType": "EC2", "PullStartedAt": 1623963608201, "PullStoppedAt": 1623963610065, "CreatedAt": 1623963607094, "StartedAt": 1623963610382, "Timestamp": 1623963900000, "CpuUtilized": 0.0, "CpuReserved": 10.0, "MemoryUtilized": 0, "MemoryReserved": 10, "StorageReadBytes": 0, "StorageWriteBytes": 0, "NetworkRxBytes": 0, "NetworkRxDropped": 0, "NetworkRxErrors": 0, "NetworkRxPackets": 14, "NetworkTxBytes": 0, "NetworkTxDropped": 0, "NetworkTxErrors": 0, "NetworkTxPackets": 0, "EBSFilesystemUtilized": 10, "EBSFilesystemSize": 20, "CloudWatchMetrics": [ { "Namespace": "ECS/ContainerInsights", "Metrics": [ { "Name": "CpuUtilized", "Unit": "None" }, { "Name": "CpuReserved", "Unit": "None" }, { "Name": "MemoryUtilized", "Unit": "Megabytes" }, { "Name": "MemoryReserved", "Unit": "Megabytes" }, { "Name": "StorageReadBytes", "Unit": "Bytes/Second" }, { "Name": "StorageWriteBytes", "Unit": "Bytes/Second" }, { "Name": "NetworkRxBytes", "Unit": "Bytes/Second" }, { "Name": "NetworkTxBytes", "Unit": "Bytes/Second" }, { "Name": "EBSFilesystemSize", "Unit": "Gigabytes" }, { "Name": "EBSFilesystemUtilzed", "Unit": "Gigabytes" } ], "Dimensions": [ ["ClusterName"], [ "ClusterName", "TaskDefinitionFamily" ] ] } ] }

类型:服务

{ "Version": "0", "Type": "Service", "ServiceName": "myCIService", "ClusterName": "myCICluster", "Timestamp": 1561586460000, "DesiredTaskCount": 2, "RunningTaskCount": 2, "PendingTaskCount": 0, "DeploymentCount": 1, "TaskSetCount": 0, "CloudWatchMetrics": [ { "Namespace": "ECS/ContainerInsights", "Metrics": [ { "Name": "DesiredTaskCount", "Unit": "Count" }, { "Name": "RunningTaskCount", "Unit": "Count" }, { "Name": "PendingTaskCount", "Unit": "Count" }, { "Name": "DeploymentCount", "Unit": "Count" }, { "Name": "TaskSetCount", "Unit": "Count" } ], "Dimensions": [ [ "ServiceName", "ClusterName" ] ] } ] }

类型:卷

{ "Version": "0", "Type": "Volume", "TaskDefinitionFamily": "myCITaskDef", "TaskId": "7ac4dfba69214411b4783a3b8189c9ba", "ClusterName": "myCICluster", "ServiceName": "myCIService", "VolumeId": "vol-1233436545ff708cb", "InstanceId": "i-0c470579dbcdbd2f3", "LaunchType": "EC2", "VolumeName": "MyVolumeName", "EBSFilesystemUtilized": 10, "EBSFilesystemSize": 20, "CloudWatchMetrics": [ { "Namespace": "ECS/ContainerInsights", "Metrics": [ { "Name": "EBSFilesystemSize", "Unit": "Gigabytes" }, { "Name": "EBSFilesystemUtilzed", "Unit": "Gigabytes" } ], "Dimensions": [ ["ClusterName"], [ "VolumeName", "TaskDefinitionFamily", "ClusterName" ], [ "ServiceName", "ClusterName" ] ] } ] }

类型:集群

{ "Version": "0", "Type": "Cluster", "ClusterName": "myCICluster", "Timestamp": 1561587300000, "TaskCount": 5, "ContainerInstanceCount": 5, "ServiceCount": 2, "CloudWatchMetrics": [ { "Namespace": "ECS/ContainerInsights", "Metrics": [ { "Name": "TaskCount", "Unit": "Count" }, { "Name": "ContainerInstanceCount", "Unit": "Count" }, { "Name": "ServiceCount", "Unit": "Count" } ], "Dimensions": [ [ "ClusterName" ] ] } ] }