Skip to content

yashodhah/spring-boot-observability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed Request Tracing — Spring Boot 3, Micrometer Tracing with OpenTelemetry

This project demonstrates how we can enable distributed request tracing in a Spring Boot application with Micrometer Tracing and OpenTelemetry.

Overview

The sample application includes two main services:

  1. Order Service

  2. Payment Service

The workflow of the application is as follows:

  1. A client places an order through the Order Service via an HTTP call.

  2. The Order Service processes the order and calls the Payment Service asynchronously over Kafka to handle the payment.

  3. The Payment Service listens on the order-events topic to process the payments.

  4. Upon processing the payment, the Payment Service calls the Order Service via an HTTP call to update the order status.

Prerequisites

Before you can run the application, ensure you have the following installed:

  • JDK 21 or higher

  • Docker

Running the Application

Start the required external dependencies: This will spin up a Kafka cluster to facilitate async communication, a UI for accessing the cluster operations, and a Jaeger instance to collect the spans.

cd .docker
docker compose up

Start the Order Service:

./mvnw spring-boot:run -pl order-service

Start the Payment Service:

./mvnw spring-boot:run -pl payment-service

After that, navigate to the http://localhost:8081/swagger-ui/index.html#/order-controller/placeOrder endpoint to place a dummy order.

Then, navigate to http://localhost:16686 to access the Jaeger UI and see the full request path across the services.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published