Class PrometheusPushGatewayManager
- java.lang.Object
-
- io.micrometer.spring.export.prometheus.PrometheusPushGatewayManager
-
public class PrometheusPushGatewayManager extends java.lang.ObjectClass 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:
- 1.1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrometheusPushGatewayManager.ShutdownOperationThe operation that should be performed on shutdown.
-
Constructor Summary
Constructors Constructor Description PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, java.time.Duration pushRate, java.lang.String job, java.util.Map<java.lang.String,java.lang.String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)Create a newPrometheusPushGatewayManagerinstance using a single threadedTaskScheduler.PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, org.springframework.scheduling.TaskScheduler scheduler, java.time.Duration pushRate, java.lang.String job, java.util.Map<java.lang.String,java.lang.String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)Create a newPrometheusPushGatewayManagerinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidshutdown()Shutdown the manager, running anyPrometheusPushGatewayManager.ShutdownOperation.
-
-
-
Constructor Detail
-
PrometheusPushGatewayManager
public PrometheusPushGatewayManager(io.prometheus.client.exporter.PushGateway pushGateway, io.prometheus.client.CollectorRegistry registry, java.time.Duration pushRate, java.lang.String job, java.util.Map<java.lang.String,java.lang.String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)Create a newPrometheusPushGatewayManagerinstance 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 operationgroupingKey- 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, java.time.Duration pushRate, java.lang.String job, java.util.Map<java.lang.String,java.lang.String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)Create a newPrometheusPushGatewayManagerinstance.- 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.
-
-