AWS Distro for OpenTelemetry

Create ECS Task Definition for EC2 with ADOT Collector

Create ECS Task Definition for EC2 with ADOT Collector

In this tutorial, we will demonstrate how to create an ECS Task Definition for EC2 with ADOT Collector.




Setup for ECS EC2

  1. Download the ECS EC2 task definition template from GitHub.
  2. Fill the following parameters in the task definition templates:
    • {{region}} - the region the data will be sent to
    • {{ecsTaskRoleArn}} - AWSOTTaskRole ARN created in the previous section
    • {{ecsExecutionRoleArn}} - AWSOTTaskExcutionRole ARN created in the previous section
    • command - Assign value to the command variable to select the config file path; the AWS Collector comes with two configs baked in for ECS customers(choose one of them based on your purpose): --config=/etc/ecs/ecs-default-config.yaml - To consume StatsD metrics, OTLP metrics/traces and X-Ray SDK traces (custom application metrics/traces) --config=/etc/ecs/container-insights/otel-task-metrics-config.yaml - To Use StatsD, OTLP, Xray and Container Resource utilization metrics
  3. Follow the ECS EC2 setup instructions to create a task definition using the given template.

On this page