Class PrometheusPushGatewayManager
- java.lang.Object
- org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager
public class PrometheusPushGatewayManager extends Object
Class that can be used to manage the pushing of metrics to aPrometheus PushGateway
. Handles the scheduling of push operations, error handling and shutdown operations.- Since:
- 2.1.0
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PrometheusPushGatewayManager.ShutdownOperation
The operation that should be performed on shutdown.
Constructor Summary
Constructors Constructor Description PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, Duration pushRate, String job, Map<String,String> groupingKeys, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)
Create a newPrometheusPushGatewayManager
instance using a single threadedTaskScheduler
.PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, org.springframework.scheduling.TaskScheduler scheduler, Duration pushRate, String job, Map<String,String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)
Create a newPrometheusPushGatewayManager
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
shutdown()
Shutdown the manager, running anyPrometheusPushGatewayManager.ShutdownOperation
.
Constructor Detail
PrometheusPushGatewayManager
public PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, Duration pushRate, String job, Map<String,String> groupingKeys, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)
Create a newPrometheusPushGatewayManager
instance using a single threadedTaskScheduler
.- Parameters:
pushGateway
- the source push gatewayregistry
- the collector registry to pushpushRate
- the rate at which push operations occurjob
- the job ID for the operationgroupingKeys
- an optional set of grouping keys for the operationshutdownOperation
- the shutdown operation that should be performed when context is closed.
PrometheusPushGatewayManager
public PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, org.springframework.scheduling.TaskScheduler scheduler, Duration pushRate, String job, Map<String,String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)
Create a newPrometheusPushGatewayManager
instance.- Parameters:
pushGateway
- the source push gatewayregistry
- the collector registry to pushscheduler
- the scheduler used for operationspushRate
- the rate at which push operations occurjob
- the job ID for the operationgroupingKey
- an optional set of grouping keys for the operationshutdownOperation
- the shutdown operation that should be performed when context is closed.
Method Detail
shutdown
public void shutdown()
Shutdown the manager, running anyPrometheusPushGatewayManager.ShutdownOperation
.