Skip to content

feat(java): add spring-boot-microservices-demo with distributed tracing#63

Open
Vinu2111 wants to merge 1 commit into
SigNoz:mainfrom
Vinu2111:java/spring-boot-microservices-demo
Open

feat(java): add spring-boot-microservices-demo with distributed tracing#63
Vinu2111 wants to merge 1 commit into
SigNoz:mainfrom
Vinu2111:java/spring-boot-microservices-demo

Conversation

@Vinu2111
Copy link
Copy Markdown

What does this PR add?

A new Java example demonstrating distributed tracing across two Spring Boot
microservices using OpenTelemetry auto-instrumentation and SigNoz.

Services

  • order-service (port 8081) — accepts orders, calls inventory-service
  • inventory-service (port 8082) — checks stock availability

What you can observe in SigNoz

  • Single distributed trace spanning both services
  • Auto-instrumented HTTP spans (inbound + outbound via RestClient)
  • Manual spans via @WithSpan (order.process, inventory.check)
  • W3C trace context propagation across service boundaries
  • Error traces for out-of-stock (400) and not-found (404) scenarios
  • JVM metrics and correlated logs — zero custom metric code needed

Stack

  • Java 21, Spring Boot 3.5.0
  • OTel Java Agent 2.26.0 (auto-instrumentation only)
  • Maven, Docker Compose

Testing done

  • Happy path ✅
  • Out of stock (400) ✅
  • Product not found (404) ✅
  • Verified traces visible in local SigNoz instance ✅
Screenshot 2026-05-27 084542 Screenshot 2026-05-27 084515 Screenshot 2026-05-27 084
<img width= 255" src="https://github.com/user-attachments/assets/43f44e6d-f9d2-4d6b-9b6b-5923c75f34e0" /> Screenshot 2026-05-27 083524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant