Amazon ECS
Get logs, metrics and traces from Amazon ECS services into Dstl8.
Send logs from your Amazon ECS services, on Fargate or EC2, to Dstl8, and metrics and traces too if your services use OpenTelemetry. There is no separate ECS source type: you use the source that matches how your tasks already emit telemetry.
Choose your path
write container stdout/stderr to CloudWatch Logs with the awslogs log driver
already run an OpenTelemetry collector or SDKs, or you want metrics and traces
If you're not sure which applies, check a task definition's log driver:
aws ecs describe-task-definition --task-definition <family> \
--query "taskDefinition.containerDefinitions[].{name:name,driver:logConfiguration.logDriver,options:logConfiguration.options}"driver of awslogs means Path 1.
Path 1: AWS CloudWatch (recommended)
This needs no changes to your tasks beyond logging to CloudWatch Logs. A CloudFormation stack that you launch from Dstl8 forwards your log groups to Dstl8; see AWS CloudWatch for the full walkthrough, permissions and options.
1. Make sure your tasks log to CloudWatch
In each container definition, use the awslogs driver. Using the /ecs/<service> log group naming lets Dstl8 recognize the logs as ECS:
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/<service-name>",
"awslogs-region": "<region>",
"awslogs-stream-prefix": "ecs",
"awslogs-create-group": "true"
}
}The task execution role needs logs:CreateLogStream and logs:PutLogEvents (the AWS managed policy AmazonECSTaskExecutionRolePolicy includes them), plus logs:CreateLogGroup if you use awslogs-create-group.
2. Create the source and launch the stack
From Sources, click Add Source, select AWS CloudWatch, name it, and click Create.
On Connect your AWS account, pick the region your ECS cluster runs in.
Choose All log groups, or Only the log groups I choose and tick your
/ecs/...groups. See Choose what's sent.Click Launch stack in AWS, acknowledge the IAM and transform notices, and click Create stack.
3. Verify
Dstl8 shows Listening for first data, then Receiving logs, usually within a minute or two. The source turns Healthy and each log group appears as a stream of type ecs, named for the service (for example, /ecs/orders becomes the stream orders). Assign the streams to a workspace as described in Assigning streams to workspaces.
Each AWS region needs its own stack, all sending to the same source.
Path 2: OpenTelemetry (OTLP)
If your services already send OpenTelemetry data to a collector (a sidecar, or a shared gateway service in the cluster), add Dstl8 as another exporter. This path carries logs, metrics and traces. Create an OpenTelemetry source as described in OpenTelemetry (OTel), then add an exporter to your collector's configuration:
Add the exporter alongside your current ones so your existing destination keeps receiving data. Store the bearer token in AWS Secrets Manager or SSM Parameter Store and inject it into the task as a secret, rather than putting it in the task definition as plain text.
Set service.name on your telemetry: it names your log streams and the services your metrics and traces are filed under. The OpenTelemetry resource detector for ECS adds the task and cluster details. Services sending straight from an SDK, without a collector, can use the same endpoint; see OpenTelemetry SDK.
The endpoint accepts OTLP over HTTP only, so use the otlphttp exporter (not otlp, which is gRPC).
Troubleshooting
No streams appear (Path 1)
Confirm the tasks are actually writing to the log group, and that the stack's region matches the log group's region. See If logs stop arriving.
Log groups missing
Only Standard-class log groups can be forwarded. Infrequent Access groups can't.
Stack creation fails
You need permission to create the IAM roles, Firehose stream and S3 bucket; see Before you start on the CloudWatch page.
OTLP data rejected (Path 2)
Check the endpoint includes your /src-<id> path, the Authorization: Bearer header holds the token for that source, and the exporter is otlphttp.
Logs arrive but no metrics or traces (Path 2)
Add the exporter to the collector's metrics and traces pipelines too.
Uninstall
Path 1: delete the stack in each region you launched it. Deleting the source in Dstl8 doesn't remove the stack.
Path 2: remove the exporter from your collector configuration, then delete the source.
Last updated