You can set up Container Insights with enhanced observability or Container Insights on new and existing Amazon ECS clusters using either the Amazon ECS console or the AWS CLI. Container Insights collects metrics at the cluster, task, and service levels. Container Insights with enhanced observability provides additional dimensions and metrics, allowing you to deep dive down to container level visibility.
If you're using Amazon ECS on an Amazon EC2 instance, launch that instance using an AMI that includes Amazon ECS agent version 1.29 or later. For information about updating your agent version, see Updating the Amazon ECS Container Agent.
Note
If the customer managed AWS KMS key that you use for your Amazon ECS Container Insights
metrics is not already configured to work with CloudWatch, you must update the key policy to
allow for encrypted logs in CloudWatch Logs. You must also associate your own AWS KMS key with the
log group in
/aws/ecs/containerinsights/
.
For more information, see Encrypt log data in CloudWatch Logs
using AWS Key Management Service.ClusterName
/performance
We recommend that you use Container Insights with enhanced observability instead of Container Insights as it provides detailed visibility in your container environment, reducing the mean time to resolution.
Set up Container Insights
with enhanced observability
You can turn on Container Insights with enhanced observability using the Amazon ECS console or AWS CLI.
Use the following command to turn on Container Insights with enhanced observability.
Set the containerInsights
account setting to
enhanced
aws ecs put-account-setting --name containerInsights --value enhanced
Example output
{
"setting": {
"name": "containerInsights",
"value": "enhanced",
"principalArn": "arn:aws:iam::123456789012:johndoe",
"type": user
}
}
Note
By default, the put-account-setting
applies only to the currently authenticated user.
To enable the setting account-wide for all users and roles, use the root user as in the following example.
aws ecs put-account-setting --name containerInsights --value enhanced --principal-arn arn:aws:iam::
accountID
:root
After you set this account setting, all new clusters automatically use
Container Insights with enhanced observability. Use the
update-cluster-settings
command to add Container Insights with
enhanced observability to existing cluster, or to upgrade clusters that currently
use Container Insights to Container Insights with enhanced observability.
aws ecs update-cluster-settings --cluster
cluster-name
--settings name=containerInsights,value=enhanced
Set up Container Insights
You can turn on Container Insights using the Amazon ECS console or AWS CLI.
To use Container Insights, set the container Insights
account
setting to enabled
. Use the following command to turn on Container
Insights.
aws ecs put-account-setting --name containerInsights --value enabled
Example output
{
"setting": {
"name": "container Insights",
"value": "enabled",
"principalArn": "arn:aws:iam::123456789012:johndoe",
"type": user
}
}
When you set the container Insights
account setting to
enabled
, all new clusters have Container Insights enabled by
default. Use the update-cluster-settings
command to add Container
Insights to an existing cluster.
aws ecs update-cluster-settings --cluster
cluster-name
--settings name=containerInsights,value=enabled