Class AbstractKafkaMetrics<T extends AbstractKafkaConfiguration>
java.lang.Object
io.micronaut.configuration.kafka.metrics.AbstractKafkaMetrics<T>
- Type Parameters:
T
- An abstract kafka configuration
- Direct Known Subclasses:
KafkaConsumerMetrics
,KafkaProducerMetrics
,KafkaStreamsMetrics
@Internal
public abstract class AbstractKafkaMetrics<T extends AbstractKafkaConfiguration>
extends Object
A class to simplify the producer and consumer metric.reporters default property.
- Since:
- 1.0
- Author:
- Christian Oestreich
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected T
addKafkaMetrics
(io.micronaut.context.event.BeanCreatedEvent<T> event, String kafkaMetricsReporterClassName) Method to add a default metric reporter if not otherwise defined.protected T
addKafkaMetrics
(io.micronaut.context.event.BeanCreatedEvent<T> event, String kafkaMetricsReporterClassName, @Nullable io.micrometer.core.instrument.MeterRegistry meterRegistry) Method to add a default metric reporter if not otherwise defined.
-
Constructor Details
-
AbstractKafkaMetrics
public AbstractKafkaMetrics()
-
-
Method Details
-
addKafkaMetrics
protected T addKafkaMetrics(io.micronaut.context.event.BeanCreatedEvent<T> event, String kafkaMetricsReporterClassName) Method to add a default metric reporter if not otherwise defined.- Parameters:
event
- The event for bean created of type AbstractKafkaConfigurationkafkaMetricsReporterClassName
- The class name to use for kafka metrics registration- Returns:
- The bean
-
addKafkaMetrics
protected T addKafkaMetrics(io.micronaut.context.event.BeanCreatedEvent<T> event, String kafkaMetricsReporterClassName, @Nullable @Nullable io.micrometer.core.instrument.MeterRegistry meterRegistry) Method to add a default metric reporter if not otherwise defined.- Parameters:
event
- The event for bean created of type AbstractKafkaConfigurationkafkaMetricsReporterClassName
- The class name to use for kafka metrics registrationmeterRegistry
- The meter registry instance to send metrics to- Returns:
- The bean
-