Class KafkaConsumerMetrics


  • public class KafkaConsumerMetrics
    extends io.prometheus.client.Collector
    Custom Prometheus Collector scraping Kafka Metrics for all registered message listeners.
    Specify the metrics to be handled by Prometheus in KAFKA_METRICS.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.prometheus.client.Collector

        io.prometheus.client.Collector.Describable, io.prometheus.client.Collector.MetricFamilySamples, io.prometheus.client.Collector.Type
    • Field Summary

      • Fields inherited from class io.prometheus.client.Collector

        MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND
    • Constructor Summary

      Constructors 
      Constructor Description
      KafkaConsumerMetrics​(java.util.List<MessageListener<?,​?>> messageListeners)
      Creates and registers a custom Prometheus Collector Collector.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<io.prometheus.client.Collector.MetricFamilySamples> collect()  
      • Methods inherited from class io.prometheus.client.Collector

        checkMetricLabelName, checkMetricName, collect, doubleToGoString, register, register, sanitizeMetricName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KafkaConsumerMetrics

        public KafkaConsumerMetrics​(java.util.List<MessageListener<?,​?>> messageListeners)
        Creates and registers a custom Prometheus Collector Collector. Note that there should be only one registered instance of this type in the application.
        Parameters:
        messageListeners - list of listeners for which to gather metrics
    • Method Detail

      • collect

        public java.util.List<io.prometheus.client.Collector.MetricFamilySamples> collect()
        Specified by:
        collect in class io.prometheus.client.Collector