类 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.- 从以下版本开始:
- 2.1.0
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
PrometheusPushGatewayManager.ShutdownOperation
The operation that should be performed on shutdown.
构造器概要
构造器 构造器 说明 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.
构造器详细资料
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
.- 参数:
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.- 参数:
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.
方法详细资料
shutdown
public void shutdown()
Shutdown the manager, running anyPrometheusPushGatewayManager.ShutdownOperation
.