Monitor Amazon ECS containers using Container Insights - Amazon Elastic Container Service

Monitor Amazon ECS containers using Container Insights

CloudWatch Container Insights collects, aggregates, and summarizes metrics and logs from your containerized applications and microservices.

Container Insights uses a containerized version of the CloudWatch agent to discover all the running containers in a cluster and collect performance data at every layer of the performance stack. Operational data is collected as performance log events. These are entries that use a structured JSON schema for high-cardinality data to be ingested and stored at scale. From this data, CloudWatch creates higher-level aggregated metrics at the cluster, service, and task level as CloudWatch metrics. The metrics include utilization for resources such as CPU, memory, disk, and network. The metrics are available in CloudWatch automatic dashboards. For information about the available metrics, see Amazon ECS Container Insights metrics in the Amazon CloudWatch User Guide.

Important

Metrics collected by CloudWatch Container Insights are charged as custom metrics. For more information about CloudWatch pricing, see CloudWatch Pricing. Amazon ECS also provides monitoring metrics that are provided at no additional cost. For more information, see Monitor Amazon ECS using CloudWatch .

Considerations

The following should be considered when using CloudWatch Container Insights.

  • CloudWatch Container Insights metrics only reflect the resources with running tasks during the specified time range. For example, if you have a cluster with one service in it but that service has no tasks in a RUNNING state, there will be no metrics sent to CloudWatch. If you have two services and one of them has running tasks and the other doesn't, only the metrics for the service with running tasks will be sent.

  • Network metrics are available for all tasks run on Fargate and tasks run on Amazon EC2 instances that use either the bridge or awsvpc network modes.

You can view Amazon ECS task and service lifecycle events within the CloudWatch Container Insights console. This helps you correlate your container metrics, logs, and events in a single view to give you a more complete operational visibility.

The events that you can view are the ones that Amazon ECS sends to Amazon EventBridge. For more information, see Amazon ECS events.

You can choose to configure performance metrics for clusters, tasks, or services. Depending on the resource you choose, the following events are reported:

  • Container instance state change events

  • Service action events

  • Task state change events