This document contains information on how to expose prometheus metrics on your sapi-nt application.
First step is to add the required dependencies including the spring boot actuator and the prometheus registry:
<!-- Spring Boot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- Micrometer Prometheus registry -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
The next step is to enable the metrics using the application properties:
management.endpoints.web.exposure.include=prometheus
management.endpoint.prometheus.enabled=true
management.endpoint.metrics.enabled=true
management.metrics.export.prometheus.enabled=true
The above properties will enable prometheus exposing all default metrics. To find out more about spring boot actuator and other configuration properties checkout the official documentation