I have a spring batch jobs in which I want to push metrics to Prometheus as suggested here
I have a requirement to push only default metrics given by Spring batch via micrometer.There is a easy way in which I dont have to anything and just add following dependency:
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
</dependency>
as mentioned here
But the second way is setting up PushGateway server and then writing Configuration Class
- Is there any difference in these two approaches?
- In second approach how to write it when all we need is default metrics?Pushgatewayurl is fine ,I understood, but if I have dozen of jobs, what to set in jobname and grouping key.?