This guide explains how to monitor Amazon ECS tasks on Fargate (serverless) using OpenTelemetry and SigNoz. You'll install the ECS Serverless Collection Agent with Foundry and Terraform, which adds an OpenTelemetry Collector to each task as a sidecar container. Applications send OTLP telemetry to the collector in their task, and the collector exports it to SigNoz.
What is ECS Fargate Monitoring with OpenTelemetry?
On Fargate, AWS manages the infrastructure, so there is no host to run a collector on. The ECS Serverless Collection Agent runs the collector in the same task as your application and provides:
- OTLP endpoints in the task for application telemetry
- Task CPU, memory, network, and storage metrics from the ECS task metadata endpoint
- The stdout and stderr of the task's containers, with the collector as the task's log router
Learn the concepts in the ECS Serverless (Fargate) - Overview.
Prerequisites
- A SigNoz backend (SigNoz Cloud or self-hosted) to receive OpenTelemetry data
- An ECS task definition for Fargate that you manage with Terraform
- Terraform 1.4 or newer and the AWS CLI, with permissions to create SSM parameters and IAM role policies
How It Works
For where the collector runs and what it collects, see How it works in the overview.
Step 1: Install the Collection Agent
Create casting.yaml, generate the module with foundryctl forge, add it to your task definition, and apply with your usual Terraform workflow.
Step 2: Configure the Collector and Applications
-
Set the application's
OTEL_EXPORTER_OTLP_ENDPOINTto the collector in its task -
Set
OTEL_SERVICE_NAMEto your service's name -
Choose which containers send their logs, as Collect Container Logs shows
Visualize in SigNoz
- Import the Container Metrics - ECS dashboard for task metrics
- Filter by cluster, task, and resource attributes such as
aws.ecs.task.family - Correlate traces and logs by
service.name