Using Micrometer to trace your Spring Boot app

Greg L. Turnquist
7 min readNov 10, 2022

If there’s one thing that eventually sneaks up on you after building and releasing an application, it’s that something breaks. Yup, applications break and not long after, our manager is asking, “What happened?”

That’s not the only thing we encounter in the Land of Production. We also sometimes see performance degrade. Certain parts of our system seem bogged down. And once again, the question arises, “What’s going on?”

This is what tracing affords us. A means to trace an operation through our application combined with metrics showing us what’s eating up all the time. And for this we turn to Micrometer.

Micrometer, launched in 2017 by the Spring team, it a metrics facade. It supports a whole host of tools, but for today we’ll use the open source distributed tracing system Zipkin.

Setting up a Spring Boot 3 application

Do you already have a Spring Boot 3 app you’d like to instrument? Great! You can skip on to the next section. In case you don’t, you’ll want to file some very simple steps.

  1. Visit https://start.spring.io
  2. Pick your favorite build tool. (I’ll be using Maven).
  3. Pick the latest version of Spring Boot 3. (I’ll be using 3.0.0-SNAPSHOT).
  4. Just leave the project metadata as is.
  5. From the dependencies panel on the right, pick Spring Web and Actuator

--

--

Greg L. Turnquist

Sr. Staff Technical Content Engineer at CockroachDB • YouTube Content Creator at https://youtube.com/@ProCoderIO • Best-Selling Author • Coffee Lover