Amazon ECS monitoring for tasks, containers and services
by Obseria · Containers and platforms- OpenTelemetry
- Infrastructure Observability
- Containers and platforms
- Category
- Containers and platforms
- Key metrics
- 10
- Ready-made
- 5 dashboards & alerts
- Setup
- 3 steps
- Standard
- OTLP
Add an OpenTelemetry Collector sidecar to your task definitions and Obseria shows CPU, memory, network and storage per ECS task and container, next to the traces your services send.
One sidecar per task
The awsecscontainermetrics receiver reads the task metadata endpoint ECS injects, so metrics work the same on Fargate and on the EC2 launch type.
Traces from the same collector
Application containers send OTLP to the sidecar on localhost; spans and task metrics share cluster, task and service attributes.
Root cause instead of guesswork
Obseria Intelligence connects a slow service with the task that ran out of memory, the CPU reservation it hit or the deploy that changed it.
Obseria interface



Ready the moment data arrives
- ECS cluster overview: tasks, CPU, memory by service
- Task memory utilized against reservation
- Alert on task memory close to its reservation
- Alert on sustained CPU utilization per service
- Network traffic per task and service
What Obseria monitors in Amazon ECS
Tasks on Fargate and EC2
CPU, memory, network and storage per task, together with the reserved CPU and memory from the task definition.
Containers in a task
CPU and memory per container, to see which container inside a task consumes the resources.
ECS services
Tasks grouped by service and cluster through resource attributes from the ECS resource detector.
Network traffic
Receive and transmit rates per task to spot chatty services and unexpected traffic.
Application telemetry
Traces and metrics from OpenTelemetry SDKs in your containers, sent over OTLP to the sidecar.
Container logs
Logs routed through FireLens or the collector, correlated with traces by trace ID.
The Amazon ECS signals that matter
Obseria collects these values automatically and shows them in ready-made dashboards and alerts.
| Metric | Unit | What it tells you |
|---|---|---|
ecs.task.cpu.utilized | Percent | CPU used by the task as a share of the available CPU. |
ecs.task.cpu.reserved | vCPU | CPU reserved for the task in the task definition, the reference for utilization. |
ecs.task.memory.utilized | Megabytes | Memory the task actually uses; compare with the reservation to anticipate OOM kills. |
ecs.task.memory.reserved | Megabytes | Memory reserved for the task in the task definition. |
ecs.task.network.rate.rx | Bytes/Second | Inbound network rate per task. |
ecs.task.network.rate.tx | Bytes/Second | Outbound network rate per task. |
ecs.task.storage.read_bytes | Bytes | Bytes read from storage by the task. |
ecs.task.storage.write_bytes | Bytes | Bytes written to storage by the task. |
container.cpu.utilized | Percent | CPU used per container, to find the container that drives the task's load. |
container.memory.utilized | Megabytes | Memory used per container inside the task. |
Set up Amazon ECS monitoring in minutes
- 1
Store the collector config
Save the collector configuration with the awsecscontainermetrics and otlp receivers as an SSM parameter; the task execution role needs ssm:GetParameters.
- 2
Add the sidecar
Add an otel/opentelemetry-collector-contrib container to the task definition that loads the configuration from the OTEL_CONFIG secret.
- 3
Point your apps at localhost
Set OTEL_EXPORTER_OTLP_ENDPOINT in the application containers to the sidecar on localhost:4318, then register the task definition and update the service.
# otel-collector.yaml: stored as SSM parameter "otel-collector-config" and
# loaded by the collector sidecar (otel/opentelemetry-collector-contrib)
# with --config=env:OTEL_CONFIG. OBSERIA_OTLP_ENDPOINT and OBSERIA_TOKEN are
# passed to the sidecar as task definition secrets.
receivers:
otlp: # traces and metrics from the app containers
protocols:
grpc: { endpoint: 0.0.0.0:4317 }
http: { endpoint: 0.0.0.0:4318 }
awsecscontainermetrics: # task metadata endpoint, injected by ECS
collection_interval: 30s
processors:
resourcedetection:
detectors: [env, ecs] # cluster, task ARN, launch type, region ...
batch: {}
exporters:
otlphttp:
endpoint: ${env:OBSERIA_OTLP_ENDPOINT}
headers:
Authorization: Bearer ${env:OBSERIA_TOKEN}
service:
pipelines:
metrics:
receivers: [otlp, awsecscontainermetrics]
processors: [resourcedetection, batch]
exporters: [otlphttp]
traces:
receivers: [otlp]
processors: [resourcedetection, batch]
exporters: [otlphttp]Why Amazon ECS monitoring needs task-level data
Amazon Elastic Container Service runs containers without a Kubernetes control plane to manage. On Fargate you do not even see the underlying hosts. That simplicity also means fewer places to look when something goes wrong: a task stops because it ran out of memory, a service scales out but stays slow, or one container in a task consumes the CPU the others need. ECS monitoring therefore has to start at the task and container level and connect those numbers with the requests your services handle.
CloudWatch publishes ECS metrics at the service and cluster level, and Container Insights adds more detail. Obseria can read CloudWatch data through the AWS integration. For per-task and per-container data next to your traces, the OpenTelemetry Collector offers a direct path: its awsecscontainermetrics receiver reads the task metadata endpoint that ECS injects into every task.
ECS monitoring with an OpenTelemetry Collector sidecar
The collector runs as an additional container in each task definition, using the otel/opentelemetry-collector-contrib image. It does three things:
- Task and container metrics: the
awsecscontainermetricsreceiver collects CPU, memory, network and storage for the task and each of its containers. Because it depends on the task metadata endpoint, it only works inside a task, on Fargate and EC2 alike. - Application telemetry: the
otlpreceiver accepts traces and metrics from the OpenTelemetry SDKs in your application containers. With theawsvpcnetwork mode, containers in a task sharelocalhost. - Resource attributes: the
resourcedetectionprocessor with theecsdetector adds cluster, task ARN, task family, launch type and region, so metrics and traces line up per service.
The configuration can live in AWS Systems Manager Parameter Store and is passed to the sidecar as a secret. The AWS Distro for OpenTelemetry provides a comparable collector image if your organisation prefers AWS-distributed builds.
Metrics that matter for Amazon ECS monitoring
- Memory:
ecs.task.memory.utilizedagainstecs.task.memory.reserved. When a container exceeds its hard memory limit, ECS stops it, so this ratio is the most important early warning. - CPU:
ecs.task.cpu.utilizedtogether withecs.task.cpu.reserved, andcontainer.cpu.utilizedto find the container responsible. - Network:
ecs.task.network.rate.rxandecs.task.network.rate.txreveal traffic spikes, retries and unexpectedly chatty dependencies. - Storage:
ecs.task.storage.read_bytesandecs.task.storage.write_bytesshow tasks that write heavily to ephemeral storage.
Common ECS problems and how to detect them
Tasks stopped for memory
A container that crosses its memory limit is stopped, and the service scheduler starts a replacement. In Obseria you see memory climbing towards the reservation, the task disappearing and a new task ARN taking its place. Comparing releases shows whether the new version needs more memory.
CPU-bound services
If tasks run near their CPU reservation, latency rises long before errors appear. Traces show the slower spans, and task metrics confirm whether the cause is CPU saturation or a slow downstream call.
Sidecars stealing resources
Log routers, proxies and other sidecars share the task's CPU and memory. Per-container metrics make it obvious when a helper container, not the application, consumes the budget.
Failed deployments
A new task definition that fails health checks leads to tasks starting and stopping repeatedly. Correlating task churn with the deploy time and the error spans from the new version shows quickly what went wrong.
Best practices for ECS container monitoring
- Mark the collector container as non-essential, so a collector problem never stops your application task.
- Store the Obseria token in Secrets Manager or Parameter Store and pass it as a secret, never as plain text in the task definition.
- Set
service.namein each application container and let the ECS detector add the infrastructure attributes. - Reserve a small, fixed amount of CPU and memory for the sidecar so its usage is predictable.
- Alert on memory utilization relative to the reservation rather than on absolute values, which differ per service.
How Obseria helps with Amazon ECS observability
Obseria receives task and container metrics and application traces from the collector sidecar over OTLP and can add CloudWatch metrics through the AWS integration. TopoGraph maps ECS services and their dependencies such as databases, queues and Lambda functions. When a service slows down, Obseria Intelligence checks task restarts, memory and CPU against reservations and recent deploys, and presents the root cause with its chain of evidence. Dashboards, alerts and SLOs are included, EU hosting is available, and all data stays exportable via OTLP.
Learn more
What is observability?
What is observability? Learn how metrics, logs, traces and profiles let you understand any system state, how it differs from monitoring, and how to start.
What is OpenTelemetry?
What is OpenTelemetry? Learn how OTel's APIs, SDKs, Collector, OTLP and semantic conventions produce vendor-neutral traces, metrics, logs and profiles.
Amazon ECS monitoring FAQ
Yes. The awsecscontainermetrics receiver reads the task metadata endpoint, which ECS provides on Fargate as well as on the EC2 launch type. No host access is required.
For task-level metrics, yes, because the receiver can only read the metadata endpoint of the task it runs in. Application traces could also go to a central collector, but the sidecar keeps metrics and traces together with consistent attributes.
Yes. ADOT ships a collector image that includes the same receiver. Obseria only needs OTLP, so the upstream contrib image and ADOT both work.
Keep using the awslogs driver and read the log groups through the AWS integration, or route logs with FireLens to the collector. In both cases trace IDs in the log lines link logs and traces.
The task execution role needs ssm:GetParameters for the configuration parameter and access to any secret holding the Obseria token. Reading the task metadata endpoint needs no additional IAM permissions.
Obseria can read CloudWatch metrics through the AWS integration, so you can keep Container Insights. The collector sidecar adds per-container data and connects it with your traces in one place.
Start monitoring Amazon ECS today
Connect Amazon ECS in minutes with OpenTelemetry or the Obseria Agent. Free for 14 days.
