Why not use `spring-boot-starter-actuator` dependency? That will give you the option of exposing plenty of endpoints.
As for `prometheus`, you will have to use `io.micrometer:micrometer-registry-prometheus` dependency in addition to enable `/actuator/prometheus`. It is plug-and-play so it will start exposing your jvm metrics.
The following config must be added in the base `application.yml` of the spring-boot service:
management:
endpoints:
web:
exposure:
include: * # health,prometheus
health:
show-details: always
You can be more granular on what endpoints you want to expose by replacing the *
with something more specific as per Spring's doco: Endpoints :: Spring Boot