Currently, we are experimenting with setting Prometheus up for monitoring for our services, internal as external. The problem is that we cannot configure Prometheus for some of our external services, but we would like these to be still included as a separate job in Prometheus.
I want to have 2 different Prometheus endpoints (e.g. /actuator/prometheus/api and /actuator/prometheus/thingworx) that have return different data.
/actuator/prometheus/apiwould have the actual data of the API (similar like if you just install the package)./actuator/prometheus/thingworxwould only return some custom metrics that we get at certain intervals from our external service.
This should, ideally, be done on a single Spring server. Can this be done with Spring Actuator and Micrometer or is this impossible?
After searching, I decided to do it another way. As you can't easily modify the
prometheusendpoint itself to include other paths (Tried withWebEndpointExtension, but didn't have any success), I created my own custom endpoint that fetches data from a service that contains the main registry that is autowired by Spring Boot and another service that contains a custom registry that is updated in intervals.This way I have full control over the path mapping of my endpoints that live under
/actuator