Amazon CloudWatch is an AWS service for monitoring logs from AWS resources, including Amazon ECS, EC2, EBS volumes, Elastic Load Balancers, and RDS. Metrics for CPU utilization, memory utilization, latency, and request counts are streamed in near-real time from these resources to CloudWatch. Some CloudWatch terms and concepts are discussed in the following table:
CloudWatch concept | Description |
Log event |
A log event, which includes a log message and a timestamp, is a record of some event/activity on a resource or application. |
Log stream |
A log stream is a continuous sequence of log events from the same resource or application. |
Log group |
A log group is a group of log streams that share the same retention, monitoring, and access control settings. Each log stream is associated with a single log group, and the log streams in a log group do not have to originate from the same resource or application. More often, the log streams originate from different resources or applications, and the log group aggregates similar monitoring data. |
Metric filter |
Metric filters filter metric observations from events to generate data points for a CloudWatch metric. |
Retention settings |
Retention settings indicate the duration for which the log events are to be kept. |
The awslogs log driver is the only log driver supported with the Fargate launch type. The awslogs log driver supports the options discussed in the following table. The awslogs log driver supports other options in addition to those discussed in the table, but ECS only supports these options:
Option |
Description |
Required |
awslogs-region |
Specifies the Amazon region to which CloudWatch logs are sent. |
Yes |
awslogs-group |
Specifies the log group to which the log streams are to send their logs. |
Yes |
awslogs-stream-prefix |
Specifies a prefix that is to be associated with a log stream. Log streams generated with the Fargate launch type have the following format: prefix-name/container-name/ecs-task-Id. |
Yes, for Fargate launch type |