Class PrometheusPushGatewayManager


  • public class PrometheusPushGatewayManager
    extends java.lang.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:
    1.1.0
    • 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 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
        groupingKey - 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,
                                            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 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.