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 a Prometheus PushGateway. Handles the scheduling of push operations, error handling and shutdown operations.
Since:
2.1.0
Author:
David J. M. Karlsen, Phillip Webb
  • Constructor Details

    • 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 new PrometheusPushGatewayManager instance using a single threaded TaskScheduler.
      Parameters:
      pushGateway - the source push gateway
      registry - the collector registry to push
      pushRate - the rate at which push operations occur
      job - the job ID for the operation
      groupingKeys - an optional set of grouping keys for the operation
      shutdownOperation - 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, TaskScheduler scheduler, Duration pushRate, String job, Map<String,String> groupingKey, PrometheusPushGatewayManager.ShutdownOperation shutdownOperation)
      Create a new PrometheusPushGatewayManager instance.
      Parameters:
      pushGateway - the source push gateway
      registry - the collector registry to push
      scheduler - the scheduler used for operations
      pushRate - the rate at which push operations occur
      job - the job ID for the operation
      groupingKey - an optional set of grouping keys for the operation
      shutdownOperation - the shutdown operation that should be performed when context is closed.
  • Method Details