Lesson 6 of 6 Container Platforms and Microservices

Monitoring Containers with Container Insights

This lesson explains how Container Insights, log routers and OpenTelemetry provide metrics, logs and traces for containerised applications, and which signals to alarm on.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the metrics and views that Container Insights and enhanced observability provide.
  • Explain how container logs and traces are collected on ECS and EKS.
  • Choose alarms that detect container problems that host metrics miss.

CloudWatch Container Insights

Container Insights collects CPU, memory, network and storage metrics and performance log events for ECS clusters, services and tasks and for EKS clusters, nodes, pods and containers, with automatic dashboards. Container Insights with enhanced observability adds detailed per-container metrics and curated views that drill down from cluster to container to find the failing component quickly. On EKS it is installed with the Amazon CloudWatch Observability add-on, which also deploys Fluent Bit for container logs and can enable Application Signals.

Logs, traces and application metrics

On ECS, the awslogs log driver sends container output to CloudWatch Logs, and FireLens runs Fluent Bit or Fluentd as a sidecar that filters logs and routes them to several destinations, such as CloudWatch Logs and Amazon Data Firehose. On EKS, Fluent Bit runs as a DaemonSet. Traces come from OpenTelemetry instrumentation through the AWS Distro for OpenTelemetry collector, and the CloudWatch agent can scrape Prometheus metrics that applications already expose.

What to alarm on

  • Service health: running task or pod count below desired, restarts and failed deployments, not only host CPU.
  • Saturation: CPU and memory utilisation against reservations, throttling and pending pods.
  • User impact: load balancer 5xx errors and latency, and service-level objectives from Application Signals.
  • Control plane: EKS control plane logs for API errors and authorisation failures.
Match the pairs

Container alarms

Exam skills 5.3.2

Match each problem with the metric that reveals it.

Log in to try this activity Interactive activities are free with an account.
Worked example

Finding a noisy container

An EKS-based search service has intermittent latency spikes, but node CPU looks normal and engineers cannot tell which component is responsible.

The platform team installs the CloudWatch Observability add-on with enhanced observability. The curated dashboards show that one pod of a sidecar-heavy deployment hits its memory limit and is repeatedly OOM-killed, causing retries in the search service.

The team raises the sidecar's memory request, adds an alarm on container restarts for the namespace and an Application Signals SLO on search latency, so a recurrence alerts before users notice.

Check yourself

Host CPU is normal, but an ECS service keeps restarting tasks. Which metric reveals the problem?

Show answer

The service's running task count compared with its desired count, from Container Insights, which shows tasks failing and being replaced even when hosts are healthy.

Exam Tips

Remember for the exam

  • Per-task and per-pod metrics with least setup: Container Insights (enhanced observability for drill-down).
  • Consistent EKS observability across clusters: the CloudWatch Observability EKS add-on.
  • Route ECS logs to several destinations with filtering: FireLens.
  • Detect crash loops: alarm on running task count or restarts, not host CPU.