Class ProducerKafkaMetricsReporter
java.lang.Object
io.micronaut.configuration.kafka.metrics.AbstractKafkaMetricsReporter
io.micronaut.configuration.kafka.metrics.ProducerKafkaMetricsReporter
- All Implemented Interfaces:
io.micrometer.core.instrument.binder.MeterBinder, Closeable, AutoCloseable, Configurable, MetricsReporter, Reconfigurable
A
MetricsReporter class for producer metrics.-
Field Summary
Fields inherited from class AbstractKafkaMetricsReporter
CLIENT_ID_TAG, METRIC_NAME_STYLE_CONFIG, NODE_ID_TAG, TOPIC_TAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Method to close bean.protected StringgetMetricName(KafkaMetric metric) Resolve the exported metric name for the supplied Kafka metric.protected StringAbstract method to implement with the metric prefix for the reporter.Methods inherited from class AbstractKafkaMetricsReporter
bindTo, configure, getIncludedTags, getMetricNameStyle, getMicrometerMetricName, init, isClientCountMetric, metricChange, metricRemovalMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MetricsReporter
contextChange, reconfigurableConfigs, reconfigure, validateReconfiguration
-
Constructor Details
-
ProducerKafkaMetricsReporter
public ProducerKafkaMetricsReporter()
-
-
Method Details
-
getMetricPrefix
Abstract method to implement with the metric prefix for the reporter.- Specified by:
getMetricPrefixin classAbstractKafkaMetricsReporter- Returns:
- prefix name
-
getMetricName
Description copied from class:AbstractKafkaMetricsReporterResolve the exported metric name for the supplied Kafka metric.- Overrides:
getMetricNamein classAbstractKafkaMetricsReporter- Parameters:
metric- The Kafka metric- Returns:
- The metric name to register with Micrometer
-
close
@PreDestroy public void close()Method to close bean. This must remain here for metrics to continue to function correctly for some reason?!.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceMetricsReporter- Overrides:
closein classAbstractKafkaMetricsReporter
-