OpenTelemetry Observability in Spring Boot 4

Опубликовано: 26 Июнь 2026
на канале: Bite Technology
40
0

Stop relying on "hope" as a production strategy and start implementing real-time insights into your applications
. In this video, Dan Vega dives into the new OpenTelemetry (OTEL) support introduced in Spring Boot 4, demonstrating how to achieve full observability in just a few minutes
.
Following the major observability rewrite in Spring Boot 3, Spring Boot 4 introduces a modularized approach with a dedicated Spring Boot starter for OpenTelemetry
. This allow developers to pull in observability features without needing the full Spring Boot Actuator stack
.
In this tutorial, you will learn how to:
Bootstrap a Spring Boot 4.0.1 project using Java 25 and the new OpenTelemetry dependency
.
Utilize Docker Compose support to automatically set up the LGTM stack (Loki, Grafana, Tempo, and Mimir) for a complete local observability environment
.
Export metrics, traces, and logs via the OTLP protocol
.
Create custom observations and metrics using the ObservationRegistry and the @Observed annotation
.
Configure the new Logback appender available in Spring Boot 4.0.1 to export logs to your observability backend
.
Visualize data in Grafana, where you can jump between traces and logs using shared Trace and Span IDs to debug complex operations
.
Resources:
Source Code: github.com/danvega/ot
Spring Boot 4 Repo: github.com/danvega/sb4
Featured Article: "Open Telemetry with Spring Boot" by Moritz Halbritter
Spring Office Hours: Featuring Brian Closel
If you found this helpful, don't forget to subscribe and happy coding!