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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bindTo
(io.micrometer.core.instrument.MeterRegistry registry) void
close()
void
The tags to include in the gauge.protected abstract String
Abstract method to implement with the metric prefix for the reporter.void
init
(List<KafkaMetric> metrics) void
metricChange
(KafkaMetric metric) void
metricRemoval
(KafkaMetric metric) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
bindTo
in interfaceio.micrometer.core.instrument.binder.MeterBinder
-
init
- Specified by:
init
in interfaceMetricsReporter
-
metricChange
- Specified by:
metricChange
in interfaceMetricsReporter
-
metricRemoval
- Specified by:
metricRemoval
in interfaceMetricsReporter
-
configure
- Specified by:
configure
in interfaceConfigurable
-
close
@PreDestroy public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceMetricsReporter
-
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
-