Building, Installing, and Setting Up the Project
This document provides a comprehensive guide for building, installing, and setting up the opentelemetry-demo project. It includes detailed instructions and code examples to support the process.
Prerequisites
Before proceeding, ensure you have the following prerequisites installed:
- Go: The latest version of Go is recommended. https://golang.org/
- Docker: Docker is required for running the demo services. https://www.docker.com/
Building the Project
Clone the repository:
git clone https://github.com/open-telemetry/opentelemetry-demo.git cd opentelemetry-demoNavigate to the
src/checkoutservicedirectory:cd src/checkoutserviceBuild the Go application:
go build -o checkout-serviceThis command will build the Go application and create an executable file named
checkout-servicein the current directory.
Installing and Setting Up the Project
Start Docker Compose:
docker-compose up -dThis command will start all the services defined in the
docker-compose.ymlfile in the background.Verify the services are running:
docker psThis command will list all running Docker containers. You should see the following services running:
opentelemetry-demo_collector_1opentelemetry-demo_cartservice_1opentelemetry-demo_checkoutservice_1opentelemetry-demo_paymentservice_1
Access the Jaeger UI:
Open your web browser and navigate to
http://localhost:16686. This will open the Jaeger UI where you can visualize the traces generated by the demo services.
Running the Project
Access the checkout service:
Open your web browser and navigate to
http://localhost:8081/. This will open the checkout service web interface.Generate traces:
You can generate traces by interacting with the checkout service web interface. For example, you can add items to your cart, proceed to checkout, and complete the purchase. These actions will generate traces that can be viewed in the Jaeger UI.
Troubleshooting
If you encounter any issues during the installation or setup process, consult the following resources:
- Project README: https://github.com/open-telemetry/opentelemetry-demo
- OpenTelemetry Documentation: https://opentelemetry.io/docs/
- Jaeger Documentation: https://www.jaegertracing.io/docs/
- Docker Documentation: https://docs.docker.com/
Conclusion
This document provided a detailed guide for building, installing, and setting up the opentelemetry-demo project. By following these steps, you can successfully run the demo services and generate traces that can be visualized in the Jaeger UI.