- Enable Metric Registrar in
Ops Manager > PAS > Settings > Metrics Registrar
Refer: Configure PAS - Metric Registrar
Note other configurabled fields:
- Endpoint scraping interval min: 15, max: 600 =
35
- Blocked tags:
deployment,job,index,id
I removedid
from blocked tags, reason discussed later below.
-
Changes required in SpringBoot app are
- pom.xml
Assuming actuator is enabled already, include micrometer prometheus endpoints
<!-- Micrometer Prometheus registry -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
- application.yml
Change required to expose prometheus end point
management:
endpoints:
web:
exposure:
include: "prometheus,health"
Refer: Register endpoint
-
Need to disable security for actuator endpoints ApplicationSecurity.java
-
Build and run locally then you should see prometheus endpoint
-
push the app to Pivotal platform (PAS)
Next > Customize PCF Metrics 1.6x