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:

Building the Project

  1. Clone the repository:

    git clone https://github.com/open-telemetry/opentelemetry-demo.git
              cd opentelemetry-demo
              
  2. Navigate to the src/checkoutservice directory:

    cd src/checkoutservice
              
  3. Build the Go application:

    go build -o checkout-service
              

    This command will build the Go application and create an executable file named checkout-service in the current directory.

Installing and Setting Up the Project

  1. Start Docker Compose:

    docker-compose up -d
              

    This command will start all the services defined in the docker-compose.yml file in the background.

  2. Verify the services are running:

    docker ps
              

    This command will list all running Docker containers. You should see the following services running:

    • opentelemetry-demo_collector_1
    • opentelemetry-demo_cartservice_1
    • opentelemetry-demo_checkoutservice_1
    • opentelemetry-demo_paymentservice_1
  3. 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

  1. Access the checkout service:

    Open your web browser and navigate to http://localhost:8081/. This will open the checkout service web interface.

  2. 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:

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.