This project showcases how to instrument a microservice written in Java using the OpenTelemetry SDK to produce telemetry data to compatible observability backends.
The simplest way to play with this code is running everything local:
docker compose up -d
Alternatively, you can have the microservice sending telemetry data to AWS. Traces will be sent to X-Ray and the metrics will be sent to CloudWatch. This is possible thanks to the AWS Distro for OpenTelemetry that provides out-of-the-box integration with AWS services. Before running the code; make sure to configure your AWS credentials in your machine, as the code will use them to connect with the target services.
- Run the collector
sh run-collector.sh
- Run the microservice
sh run-microservice.sh
- Invoke the API
curl -X GET http://localhost:8888/hello
This project is licensed under the Apache 2.0 License.