0

I am running a Job on multiple nodes using Spring batch.

implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus:1.3.2'
implementation 'io.prometheus:simpleclient_pushgateway:0.9.0'

And basically, PushGateway's grouping key is used as host and job name.

And while maintaining the above metrics,
I want to create a logic that is sent once again by excluding the host from the grouping key and configuring it only with the job name.

for example
When A Job is executed, we want to have two Groups in PushGateway.
Group1 - host=node1, jobName=A Job
Group2 - jobName=A Job

I wonder if this is possible and how do you think about it?

  • `And basically, PushGateway's grouping key is used as host and job name.`: Where is that configured? This is where you should be able to exclude `host`. – Mahmoud Ben Hassine Sep 29 '22 at 08:10
  • @MahmoudBenHassine Set in `management.metrics.export.prometheus.pushgateway.grouping-key`. There are a few more group keys, but for brevity, I've written the question with only job name and host . I want to create two PushGateways with different group keys in one app and send data. So I was wondering if it is possible in libardy for spring actuator etc. – raw-carrot Sep 30 '22 at 05:55
  • I think you need to do it programmatically then, meaning configuring your PushGateway yourself as needed. I'm not sure there is a way to do that declaratively with a property. – Mahmoud Ben Hassine Oct 01 '22 at 08:22

0 Answers0