Class AbstractKafkaMetricsReporter
java.lang.Object
io.micronaut.configuration.kafka.metrics.AbstractKafkaMetricsReporter
- All Implemented Interfaces:
io.micrometer.core.instrument.binder.MeterBinder, Closeable, AutoCloseable, Configurable, MetricsReporter, Reconfigurable
- Direct Known Subclasses:
ConsumerKafkaMetricsReporter, KafkaStreamsMetricsReporter, ProducerKafkaMetricsReporter
@Internal
public abstract class AbstractKafkaMetricsReporter
extends Object
implements 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(@NonNull io.micrometer.core.instrument.MeterRegistry registry) voidclose()voidThe tags to include in the gauge.protected StringgetMetricName(KafkaMetric metric) Resolve the exported metric name for the supplied Kafka metric.protected abstract StringAbstract method to implement with the metric prefix for the reporter.voidinit(List<KafkaMetric> metrics) voidmetricChange(KafkaMetric metric) voidmetricRemoval(KafkaMetric metric) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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 interfaceMetricsReporter
-
metricChange
- Specified by:
metricChangein interfaceMetricsReporter
-
metricRemoval
- Specified by:
metricRemovalin interfaceMetricsReporter
-
configure
- Specified by:
configurein interfaceConfigurable
-
close
@PreDestroy public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceMetricsReporter
-
getMetricName
Resolve the exported metric name for the supplied Kafka metric.- Parameters:
metric- The Kafka metric- Returns:
- The metric name to register with Micrometer
-
getIncludedTags
-
getMetricPrefix
Abstract method to implement with the metric prefix for the reporter.- Returns:
- prefix name
-