Amazon ECS

Embed
Preview of the card
<a href="https://watchtowerops.net/docs/ecs"><img src="https://watchtowerops.net/docs/_api/public/orgs/aa5959cb-1a0b-4a9a-bc9a-913e7ac31cd9/spaces/b7aac181-9916-4805-b253-becc5fd2ca62/pages/2cd33b0b-c117-4b96-8b5b-1d7007ef009a/social-card.svg?v=3e7ae33eec8b" alt="Amazon ECS" width="600" height="315"></a>

Container metrics

Run the agent as a sidecar (or in a DaemonSet-style service) in the task. Its ecs receiver reads the task metadata endpoint v4 (ECS_CONTAINER_METADATA_URI_V4, set by ECS) and reports per container CPU, memory and network with aws.ecs.* resource attributes:

  • aws.ecs.cluster.arn

  • aws.ecs.task.arn, aws.ecs.task.family, aws.ecs.task.revision

  • container.id, container.name

modules:
  ecs:
    enabled: true

The task metadata endpoint does not expose the service name. To see services in the entity explorer, set aws.ecs.service.name (and optionally aws.ecs.service.arn) through OTEL_RESOURCE_ATTRIBUTES on the task definition.

Entities

The worker derives three entity kinds from those resource attributes, each nested under its owner (see GET /v1/projects/{prj}/infra/entities?kind=ecs.task and the entity health routes):

Kind

Keyed by

Parent

ecs.cluster

aws.ecs.cluster.arn

—

ecs.service

aws.ecs.service.arn or .name

its cluster

ecs.task

aws.ecs.task.arn

its service (else its cluster)

aws.ecs.task.revision is an identity attribute, so a new deployment is recorded in the task's entity_history. A task with no service (for example a standalone RunTask) hangs directly under its cluster. The container of the task remains a container entity as on any host.

Serverless (Fargate)

Fargate tasks that run the OTel Lambda-style faas.* instrumentation also appear in the serverless explorer (serverless.md); otherwise use the ECS entities and the container metrics above.

Updated