I am using spring boot 2.0 and added the below dependencies in POM
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
My application.yml looks like this
management.endpoints.web.base-path = /manage
management.endpoints.web.exposure.include = "*"
endpoints.prometheus.enabled = true
when I access Prometheus at
localhost/manage/prometheus
I am able to see all the metrics.
Next, my target is to see the above metrics in Prometheus UI. For this, I added the below dependencies in my POM
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_servlet</artifactId>
<version>${prometheus.version}</version>
</dependency>
What are the next steps for me to see metrics in Prometheus UI, final target is to integrate Prometheus to Grafana.
PS: I did a search on google and tried adding prometheus.yml and adding annotations like @EnablePrometheusEndpoint nothing worked as all the articles are old.
Edit : Also how to configure prometheus.yml ( metrics_path, targets)if the spring boot jar is hosted in different host (Azure/AWS) and prometheus server is in different host.