Skip to content

mhalbritter/spring-boot-and-opentelemetry

Repository files navigation

Spring Boot and OpenTelemetry

This project showcases the OpenTelemetry integration in Spring Boot.

Preparation

docker compose up

Start services

Start all three services: user-service, greeting-service and hello-service.

Call hello-service

curl -i localhost:8080/api/1

You can request different users:

curl -i localhost:8080/api/2

or

curl -i localhost:8080/api/3

You can also request the greeting in different languages:

curl -i -H "Accept-Language: de" localhost:8080/api/1

It knows about English, German and Spanish.

If you want to see a trace with an error in it, use this:

curl -i localhost:8080/api/boom

Observability signals

The applications are configured to send logs, metrics and traces to the Grafana LGTM stack, which is running in Docker Compose.

Architecture

user-service knows the users, greeting-service knows the greetings. hello-service calls the user-service to get the user for a given id, then calls the greeting-service to get the greeting for a given locale, then combines the two to create a greeting and returns it.

About

Showcase of Spring Boot using OpenTelemetry

Resources

Stars

Watchers

Forks

Contributors

Languages