How to Enable ContainerInsights on AWS ECS from the AWS CLI
If you need to enable Container Insights for an ECS cluster, by using the AWS CLI, then you can do the following:
aws ecs update-cluster-settings
--cluster <cluster-name>
--settings name=containerInsights,value=enabled
--region <aws_region>
Container Insights gives you CPU, memory, disk, and network metrics for your ECS tasks and services in CloudWatch. Without it, you’re flying blind on resource utilization. I enable this on every cluster — the extra CloudWatch costs are minimal compared to the visibility you get.
Note that this only enables the cluster-level setting. Your tasks also need the CloudWatch agent or FireLens configured to actually ship the metrics. For Fargate tasks, Container Insights works automatically once enabled at the cluster level.