Class AbstractKafkaMetricsReporter
java.lang.Object
io.micronaut.configuration.kafka.metrics.AbstractKafkaMetricsReporter
- All Implemented Interfaces:
io.micrometer.core.instrument.binder.MeterBinder,Closeable,AutoCloseable,org.apache.kafka.common.Configurable,org.apache.kafka.common.metrics.MetricsReporter,org.apache.kafka.common.Reconfigurable
- Direct Known Subclasses:
ConsumerKafkaMetricsReporter,ProducerKafkaMetricsReporter
@Internal
public abstract class AbstractKafkaMetricsReporter
extends Object
implements org.apache.kafka.common.metrics.MetricsReporter, io.micrometer.core.instrument.binder.MeterBinder, Closeable
A
MetricsReporter that binds metrics to micrometer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindTo(io.micrometer.core.instrument.MeterRegistry registry) voidclose()voidThe tags to include in the gauge.protected abstract StringAbstract method to implement with the metric prefix for the reporter.voidvoidmetricChange(org.apache.kafka.common.metrics.KafkaMetric metric) voidmetricRemoval(org.apache.kafka.common.metrics.KafkaMetric metric) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.metrics.MetricsReporter
contextChange, reconfigurableConfigs, reconfigure, validateReconfiguration
-
Field Details
-
CLIENT_ID_TAG
- See Also:
-
TOPIC_TAG
- See Also:
-
NODE_ID_TAG
- See Also:
-
-
Constructor Details
-
AbstractKafkaMetricsReporter
public AbstractKafkaMetricsReporter()
-
-
Method Details
-
bindTo
public void bindTo(@NonNull io.micrometer.core.instrument.MeterRegistry registry) - Specified by:
bindToin interfaceio.micrometer.core.instrument.binder.MeterBinder
-
init
- Specified by:
initin interfaceorg.apache.kafka.common.metrics.MetricsReporter
-
metricChange
public void metricChange(org.apache.kafka.common.metrics.KafkaMetric metric) - Specified by:
metricChangein interfaceorg.apache.kafka.common.metrics.MetricsReporter
-
metricRemoval
public void metricRemoval(org.apache.kafka.common.metrics.KafkaMetric metric) - Specified by:
metricRemovalin interfaceorg.apache.kafka.common.metrics.MetricsReporter
-
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.Configurable
-
close
@PreDestroy public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.apache.kafka.common.metrics.MetricsReporter
-
getIncludedTags
The tags to include in the gauge. Defaults to just the client-id.- Returns:
- The tags to include
-
getMetricPrefix
Abstract method to implement with the metric prefix for the reporter.- Returns:
- prefix name
-