AWS Distro for OpenTelemetry
Run ADOT Collector Examples with Docker
Run ADOT Collector Examples with Docker
This example will introduce how to install ADOT Collector to collect metrics/traces data from a sample application running in the Docker container. The sample application will generate Open Telemetry Protocol (OTLP) format based metrics and traces data and send to AWS CloudWatch and X-Ray consoles.
Please follow the steps below to try ADOT Collector.
Prerequisite
- To retrieve your
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
andAWS_REGION
for the following example, please see here for setting up your AWS credentials. - Installed docker runtime on your laptop.
Steps
- Download the source code in this repo and enter into
examples
folder. Open and Editdocker-compose.yaml
file with the expectedAWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
andAWS_REGION
in the section below. The region is where the data will be sent to.
(Note, if you can’t access the repo, you can download docker-compose.yaml
file at
here and edit
AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
and AWS_REGION
with the expected values.
image: amazon/aws-otel-collector:latestcommand: ["--config=/etc/otel-agent-config.yaml"]environment: - AWS_ACCESS_KEY_ID=<to_be_added> - AWS_SECRET_ACCESS_KEY=<to_be_added> - AWS_REGION=<to_be_added>volumes: - ../config.yaml:/etc/otel-agent-config.yaml // use default config - ~/.aws:/home/aoc/.awsports: - "1777:1777" # pprof extension - "55679:55679" # zpages extension - "4317:4317" # OTLP receiver - "13133" # health_check
- Once AWS credential has been updated in the
docker-compose.yaml
file, run the following command within the same folder where thedocker-compose.yaml
file is located.
cd examples; docker-compose up -d
Once ADOT Collector and Sample application docker images are up and running. We can check the monitoring data in CloudWatch and X-Ray consoles.
CloudWatch Metrics console - (AOCDockerDemo/AOCDockerDemoService)
AWS X-Ray Console
To stop this demo with ADOT Collector, please run the following command.
docker stop $(docker ps -aq)