Spring Boot 4 introduces a a really nice addition to the observability story: a dedicated OpenTelemetry starter that lets you export metrics, traces, and logs without pulling in the full Actuator dependency.
In this tutorial, I walk you through the new spring-boot-starter-opentelemetry from scratch. You'll learn how to set up a complete observability stack using Docker Compose, visualize everything in Grafana, and connect your logs directly to traces for powerful debugging workflows. As I like to say, "hope is not a production strategy", and this starter makes production-ready observability easier than ever.
What You'll Learn
âś… How the new OpenTelemetry starter differs from using Spring Boot Actuator
âś… Setting up the LGTM stack (Loki, Grafana, Tempo, Mimir) with Docker Compose
âś… Viewing traces and metrics in Grafana out of the box
âś… Adding custom metrics using @Observed annotations
âś… Configuring log export via OTLP (new in Spring Boot 4.0.1)
âś… Connecting logs to traces for seamless debugging
Resources
👋🏻Connect with me: