Class KafkaBinderMetrics
- java.lang.Object
-
- org.springframework.cloud.stream.binder.kafka.KafkaBinderMetrics
-
- All Implemented Interfaces:
io.micrometer.core.instrument.binder.MeterBinder
,AutoCloseable
,EventListener
,org.springframework.context.ApplicationListener<BindingCreatedEvent>
public class KafkaBinderMetrics extends Object implements io.micrometer.core.instrument.binder.MeterBinder, org.springframework.context.ApplicationListener<BindingCreatedEvent>, AutoCloseable
Metrics for Kafka binder.- Author:
- Henryk Konsek, Soby Chacko, Artem Bilan, Oleg Zhurakousky, Jon Schneider, Thomas Cheyney, Gary Russell, Lars Bilger, Tomek Szmytka, Nico Heller
-
-
Field Summary
Fields Modifier and Type Field Description static String
OFFSET_LAG_METRIC_NAME
Offset lag micrometer metric name.
-
Constructor Summary
Constructors Constructor Description KafkaBinderMetrics(KafkaMessageChannelBinder binder, KafkaBinderConfigurationProperties binderConfigurationProperties)
KafkaBinderMetrics(KafkaMessageChannelBinder binder, KafkaBinderConfigurationProperties binderConfigurationProperties, org.springframework.kafka.core.ConsumerFactory<?,?> defaultConsumerFactory, io.micrometer.core.instrument.MeterRegistry meterRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindTo(io.micrometer.core.instrument.MeterRegistry registry)
void
close()
void
onApplicationEvent(BindingCreatedEvent event)
void
setTimeout(int timeout)
-
-
-
Field Detail
-
OFFSET_LAG_METRIC_NAME
public static final String OFFSET_LAG_METRIC_NAME
Offset lag micrometer metric name. This can be used for meter filtering.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KafkaBinderMetrics
public KafkaBinderMetrics(KafkaMessageChannelBinder binder, KafkaBinderConfigurationProperties binderConfigurationProperties, org.springframework.kafka.core.ConsumerFactory<?,?> defaultConsumerFactory, @Nullable io.micrometer.core.instrument.MeterRegistry meterRegistry)
-
KafkaBinderMetrics
public KafkaBinderMetrics(KafkaMessageChannelBinder binder, KafkaBinderConfigurationProperties binderConfigurationProperties)
-
-
Method Detail
-
setTimeout
public void setTimeout(int timeout)
-
bindTo
public void bindTo(io.micrometer.core.instrument.MeterRegistry registry)
- Specified by:
bindTo
in interfaceio.micrometer.core.instrument.binder.MeterBinder
-
onApplicationEvent
public void onApplicationEvent(BindingCreatedEvent event)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<BindingCreatedEvent>
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-