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<org.springframework.cloud.stream.binder.BindingCreatedEvent>, org.springframework.context.Lifecycle

public class KafkaBinderMetrics extends Object implements io.micrometer.core.instrument.binder.MeterBinder, org.springframework.context.ApplicationListener<org.springframework.cloud.stream.binder.BindingCreatedEvent>, AutoCloseable, org.springframework.context.Lifecycle
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, Kurt Hong, Omer Celik
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Offset lag micrometer metric name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    KafkaBinderMetrics(KafkaMessageChannelBinder binder, org.springframework.cloud.stream.binder.kafka.properties.KafkaBinderConfigurationProperties binderConfigurationProperties)
     
    KafkaBinderMetrics(KafkaMessageChannelBinder binder, org.springframework.cloud.stream.binder.kafka.properties.KafkaBinderConfigurationProperties binderConfigurationProperties, org.springframework.kafka.core.ConsumerFactory<?,?> defaultConsumerFactory, io.micrometer.core.instrument.MeterRegistry meterRegistry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bindTo(io.micrometer.core.instrument.MeterRegistry registry)
     
    void
     
    boolean
     
    void
    onApplicationEvent(org.springframework.cloud.stream.binder.BindingCreatedEvent event)
     
    void
    setTimeout(int timeout)
     
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution
  • Field Details

    • 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:
  • Constructor Details

    • KafkaBinderMetrics

      public KafkaBinderMetrics(KafkaMessageChannelBinder binder, org.springframework.cloud.stream.binder.kafka.properties.KafkaBinderConfigurationProperties binderConfigurationProperties, org.springframework.kafka.core.ConsumerFactory<?,?> defaultConsumerFactory, @Nullable io.micrometer.core.instrument.MeterRegistry meterRegistry)
    • KafkaBinderMetrics

      public KafkaBinderMetrics(KafkaMessageChannelBinder binder, org.springframework.cloud.stream.binder.kafka.properties.KafkaBinderConfigurationProperties binderConfigurationProperties)
  • Method Details

    • setTimeout

      public void setTimeout(int timeout)
    • bindTo

      public void bindTo(io.micrometer.core.instrument.MeterRegistry registry)
      Specified by:
      bindTo in interface io.micrometer.core.instrument.binder.MeterBinder
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.cloud.stream.binder.BindingCreatedEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.cloud.stream.binder.BindingCreatedEvent>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle