Archive · AWS

CloudWatch Container Insights for ECS

Per-service CPU, memory and network graphs for containers, with a single setting.

1 min read

  • Amazon ECS
  • CloudWatch Container Insights
  • AWS Fargate

Container Insights collects metrics and logs from ECS and EKS and gives dashboards by cluster, service and task.

Enable it on an ECS cluster:

aws ecs update-cluster-settings --cluster prod \
  --settings name=containerInsights,value=enabled --region ap-south-1

New metrics appear in the ECS/ContainerInsights namespace: CpuUtilized, MemoryUtilized, NetworkRxBytes, RunningTaskCount and more. Open CloudWatch, Container Insights to see the per-service view.

Useful alarms:

Metric Alarm when
MemoryUtilized vs reserved Over 85 percent for 10 minutes
RunningTaskCount Below the desired count
CpuUtilized Sustained over 80 percent

Container Insights metrics are billed as custom metrics, so enable it where you need that detail. Use CloudWatch dashboards to put the service graphs, the load balancer’s 5XX count and the database’s connections on one page.