For the complete documentation index, see llms.txt. Markdown versions are available by appending .md to documentation URLs.

ECS EC2 Collection Agent - Configure

SigNoz Cloud - This page applies to SigNoz Cloud editions.
Self-Host - This page applies to self-hosted SigNoz editions.

This guide covers configuring your daemon service after installation, verifying data flow, and setting up application data collection.

Prerequisites

Before configuring, ensure you have:

  • Completed the installation steps
  • Daemon service running on your ECS cluster
  • Access to SigNoz Cloud or self-hosted instance

Verify Data Collection

Log into your SigNoz instance and check that ECS infrastructure metrics and logs are being received.

To visualize ECS data, import pre-built dashboards:

Import these in the Dashboards section of SigNoz.

Send Data from Applications

In this section, we will see how to send data from applications deployed in ECS to SigNoz Cloud using Daemon Service we created in the previous section.


Step 1: Add OpenTelemetry Instrumentation to your Application

To add OpenTelemetry instrumentation to your application, you can follow the docs here.

Step 2: Add Entrypoint to your Application Container

We need to add an entrypoint to the application container to set the OTEL_EXPORTER_OTLP_ENDPOINT environment variable to the endpoint of the daemon service. Such that the application container can send data to the daemon container running in the same host.

The AWS entrypoints below read the instance IP from IMDSv2. AWS recommends an IMDSv2 hop limit of 2 for containers. Account or launch settings can change the default, so run this command for each container instance in your cluster:

aws ec2 modify-instance-metadata-options \
  --instance-id <instance-id> \
  --http-put-response-hop-limit 2 \
  --http-endpoint enabled

Verify these values:

  • <instance-id>: The Amazon EC2 instance ID (i-...) of each container instance. Find it on the Instances page of the EC2 console.

Method 1: Updating entrypoint in task definition

We need to obtain the endpoint or IP address of the instance on which the task is running. We can do this by querying the metadata service of the instance. For EC2, the metadata service is available at 169.254.169.254 and needs an IMDSv2 session token.

The entryPoint will look like:

{
       
      "entryPoint": [
        "sh",
        "-c",
        "TOKEN=$(curl -s -X PUT http://169.254.169.254/latest/api/token -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\"); export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf OTEL_EXPORTER_OTLP_ENDPOINT=\"http://$(curl -s -H \"X-aws-ec2-metadata-token: $TOKEN\" http://169.254.169.254/latest/meta-data/local-ipv4):4318\"; <Application Startup Commands>"
      ],
			"command": [],
			
}
  • Replace <Application Startup Commands> with the commands to start your application.
  • The entrypoint sets OTLP/HTTP on port 4318. To export over gRPC, set OTEL_EXPORTER_OTLP_PROTOCOL=grpc and use port 4317.

3. Add Service Name of your Application

To add the service name of your application, you need to set the OTEL_RESOURCE_ATTRIBUTES environment variable of the application container to service.name=<your-service-name>.

In your task definition, you can add the following lines.

 
    ContainerDefinitions:
        - Name: <your-container-name>
          
          Environment:
            - Name: OTEL_RESOURCE_ATTRIBUTES
              Value: service.name=<your-service-name>
          
 

In case of JSON task definition, you can add the following lines.

 
    "containerDefinitions": [
        {
            "name": "<your-container-name>",
            
            "environment": [
                {
                    "name": "OTEL_RESOURCE_ATTRIBUTES",
                    "value": "service.name=<your-service-name>"
                }
            ],
            
        }
    ],
 
 

4. Add ECS Task Attributes from your Application

The daemon collector runs in its own ECS task, so it cannot tell which task your telemetry came from. To add the ECS task of your application to its telemetry, enable the ECS resource detector in your OpenTelemetry SDK. The detector adds attributes such as aws.ecs.task.family and aws.ecs.task.arn to traces, metrics, and OTLP logs.

  • Go: pass resource.WithFromEnv() and resource.WithDetectors(ecs.NewResourceDetector()) to resource.New(). Then pass the result to each provider with WithResource(res). The detector is in go.opentelemetry.io/contrib/detectors/aws/ecs.
  • Node.js: set the resourceDetectors option of NodeSDK to [envDetector, awsEcsDetector]. awsEcsDetector is in @opentelemetry/resource-detector-aws.
  • Python: pass OTELResourceDetector() and AwsEcsResourceDetector() to get_aggregated_resources(). Then pass the result as resource= to TracerProvider, MeterProvider, and LoggerProvider. AwsEcsResourceDetector is in opentelemetry-sdk-extension-aws.
  • Java agent: set OTEL_RESOURCE_PROVIDERS_AWS_ENABLED=true in the container environment. See the Java agent configuration.

The environment detectors in the Go, Node.js, and Python setups keep the service.name from step 3. Each application container reads its own ECS task metadata, so the attributes match the task it runs in. Logs that the collector reads from container output with filelog do not get these attributes.

To make sure that the detector works, open a trace of your service in SigNoz. Its resource attributes show aws.ecs.task.arn.

Next Steps

Is this page helpful

Last updated—October 06, 2026

Edit on GitHub