Class KafkaConsumerMetrics
- java.lang.Object
-
- io.prometheus.client.Collector
-
- org.sdase.commons.server.kafka.prometheus.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 inKAFKA_METRICS
.
-
-
Constructor Summary
Constructors Constructor Description KafkaConsumerMetrics(java.util.List<MessageListener<?,?>> messageListeners)
Creates and registers a custom Prometheus CollectorCollector
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<io.prometheus.client.Collector.MetricFamilySamples>
collect()
-
-
-
Constructor Detail
-
KafkaConsumerMetrics
public KafkaConsumerMetrics(java.util.List<MessageListener<?,?>> messageListeners)
Creates and registers a custom Prometheus CollectorCollector
. 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
-
-