I was trying to get metrics to work for a while using a generated IDEA Spring boot app.
I selected the following options:
WebFlux
Metrics
Postgres (later changed to r2dbc after realising needed non-blocking)
Pulsar
Docker Compose
Then I tried to get metrics to start flowing but nothing (setup otel collector in the compose with grafana and prometheus). I was following the page on Spring metrics by adding io.micrometer:micrometer-registry-otlp
to the project. It says it would just see that and start flowing metrics. Nothing.
I found a post from someone which was a couple years old and they had org.springframework.boot:spring-boot-starter-actuator
as a dependency. Once I added that everything started to work.
Could I have missed something else or do Spring Boot applications require actuator
for things like metrics?
I was assuming everything I needed was included in the generated skeleton from IDEA.
2
As @BIBOO unit pointed out. Read from the start of the section
docs.spring.io/spring-boot/reference/actuator/enabling.html
The spring-boot-actuator module provides all of Spring Boot’s production-ready features. The recommended way to enable the features is to add a dependency on the spring-boot-starter-actuator starter.