Class ConsumerTopicMessageHistogram
- java.lang.Object
-
- org.sdase.commons.server.kafka.prometheus.ConsumerTopicMessageHistogram
-
public class ConsumerTopicMessageHistogram extends java.lang.Object
The central definition of the message consumer duration histogram. This is the definition of the message consumed duration histogram as it should be provided by all Kafka consumers to measure message process durations with Prometheus.
-
-
Constructor Summary
Constructors Constructor Description ConsumerTopicMessageHistogram()
Creates and registers a newHistogram
matching the specification of thisConsumerTopicMessageHistogram
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
observe(double durationSeconds, java.lang.String producerName, java.lang.String topicName)
Observes the given message duration and adds the defined labels.void
unregister()
Unregisters the histogram.
-
-
-
Method Detail
-
unregister
public void unregister()
Unregisters the histogram. Should be called when the context is closed.
-
observe
public void observe(double durationSeconds, java.lang.String producerName, java.lang.String topicName)
Observes the given message duration and adds the defined labels.- Parameters:
durationSeconds
- the duration to addproducerName
- the name of the producertopicName
- the name of the topic
-
-