AWS Distro for OpenTelemetry
Setting up AWS Distro for OpenTelemetry Collector in Amazon Elastic Container Service
Setting up AWS Distro for OpenTelemetry Collector in Amazon Elastic Container Service
In this tutorial, we will demonstrate how to run AWS Distro for OpenTelemetry Collector (ADOT Collector) as a sidecar on the Amazon Elastic Container Service (Amazon ECS) in Fargate and in Amazon Elastic Compute Cloud (Amazon EC2) mode. We provide a sample application within the same Amazon ECS task to send monitoring data to AWS OTel Collector.
1. Create a Cluster
If you don't have a cluster, follow this tutorial to create a new one.
2. Setup the ADOT Collector for Xray, StatsD and ECS Container metrics
There are three different ways to get started by installing ADOT Collector as a sidecar in ECS- using CloudFormation template, using Task Definition, and using AWS Management Console. Follow any of the following three options to setup the collector.
2.1 Setup using CloudFormation template
The CloudFormation template will create all the necessary resources to get the Collector ready. This option is recommended for the beginners who are new to ECS.
2.2 Setup using ECS Task Definition
This option is recommended for developers who are familier with ECS and know how to run a task using a given task definition.
- Create IAM Policy
- Create IAM Role
- Create Task Definition
- Deploy Task
2.3 Setup using AWS Management Console
This option shows the whole process step by step to setup ADOT Collector using AWS Management Console.
3. Setup the ADOT Collector for ECS EC2 instance Metrics
There are three different ways to get started by installing ADOT as a daemon service in ECS - using CloudFormation template, using Task Definition, and using AWS Management Console. Follow any of the following three options to setup the collector.
3.1 Setup using CloudFormation template
The CloudFormation template will create all the necessary resources to get the Collector ready. This option is recommended for the beginners who are new to ECS.
3.2 Setup using ECS Task Definition
This option is recommended for developers who are familier with ECS and know how to run a task using a given task definition.
3.3 Setup using AWS Management Console
This option shows the whole process step by step to setup ADOT Collector using AWS Management Console.
- Create IAM Policy
- Create IAM Role
- Create Task Definition using AWS Console
- Deploy task as a daemon service
4. Results
- See container metrics in CloudWatch
- See traces in AWS X-Ray
- See StatsD metrics in CloudWatch
- See instance metrics in CloudWatch
5. Custom OpenTelemetry Configuration
[Optional] Use custom OpenTelemetry configuration file from SSM Parameter6. Reference
Note: After you finished the tutorial, remember to shut down the new ECS cluster created in the tutorial in order to avoid any charges.