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 enabledVerify 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, setOTEL_EXPORTER_OTLP_PROTOCOL=grpcand use port4317.
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. This can be done by multiple ways depending on the network mode and cloud provider.
The entryPoint will look like the following based on your network mode and cloud provider:
-
Using default networking mode i.e. Bridge:
{ "entryPoint": [ "sh", "-c", "export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf OTEL_EXPORTER_OTLP_ENDPOINT=\"http://172.17.0.1:4318\"; <Application Startup Commands>" ], "command": [], } -
Using Bridge mode with custom docker network
If you are using custom docker networking, you would have to use
ExtraHostsin your task definition.{ "extraHosts": [ { "hostname": "signoz-collector", "ipAddress": "host-gateway" } ] }And the
entryPointwill look like:{ "entryPoint": [ "sh", "-c", "export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf OTEL_EXPORTER_OTLP_ENDPOINT=\"http://signoz-collector:4318\"; <Application Startup Commands>" ], "command": [], } -
If network mode is not Bridge, and AWS EC2 instance:
{ "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": [], } -
If network mode is not Bridge, and GCP instance:
{ "entryPoint": [ "sh", "-c", 'export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf OTEL_EXPORTER_OTLP_ENDPOINT="http://$(curl "http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/ip?recursive=true&alt=text" -H "Metadata-Flavor: Google"):4318"; <Application Startup Commands>' ], "command": [], }
NOTES:
- Replace
<Application Startup Commands>with the commands to start your application. - The entrypoint sets OTLP/HTTP on port
4318. To export over gRPC, setOTEL_EXPORTER_OTLP_PROTOCOL=grpcand use port4317. - For more information about the metadata server, refer https://www.baeldung.com/linux/cloud-ip-meaning
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()andresource.WithDetectors(ecs.NewResourceDetector())toresource.New(). Then pass the result to each provider withWithResource(res). The detector is ingo.opentelemetry.io/contrib/detectors/aws/ecs. - Node.js: set the
resourceDetectorsoption ofNodeSDKto[envDetector, awsEcsDetector].awsEcsDetectoris in@opentelemetry/resource-detector-aws. - Python: pass
OTELResourceDetector()andAwsEcsResourceDetector()toget_aggregated_resources(). Then pass the result asresource=toTracerProvider,MeterProvider, andLoggerProvider.AwsEcsResourceDetectoris inopentelemetry-sdk-extension-aws. - Java agent: set
OTEL_RESOURCE_PROVIDERS_AWS_ENABLED=truein 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.