Class KafkaStreamsMicrometerListener

java.lang.Object
org.springframework.kafka.core.KafkaMetricsSupport<org.apache.kafka.streams.KafkaStreams>
org.springframework.kafka.streams.KafkaStreamsMicrometerListener
All Implemented Interfaces:
StreamsBuilderFactoryBean.Listener

public class KafkaStreamsMicrometerListener extends KafkaMetricsSupport<org.apache.kafka.streams.KafkaStreams> implements StreamsBuilderFactoryBean.Listener
Creates a KafkaStreamsMetrics for the KafkaStreams.
Since:
2.5.3
  • Field Summary

    Fields inherited from class org.springframework.kafka.core.KafkaMetricsSupport

    meterRegistry, scheduler, tags
  • Constructor Summary

    Constructors
    Constructor
    Description
    KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry)
    Construct an instance with the provided registry.
    KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry, List<io.micrometer.core.instrument.Tag> tags)
    Construct an instance with the provided registry and tags.
    KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry, List<io.micrometer.core.instrument.Tag> tags, org.springframework.scheduling.TaskScheduler taskScheduler)
    Construct an instance with the provided registry, tags and task scheduler.
    KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry, org.springframework.scheduling.TaskScheduler taskScheduler)
    Construct an instance with the provided registry and task scheduler.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected io.micrometer.core.instrument.binder.MeterBinder
    createClientMetrics(org.apache.kafka.streams.KafkaStreams client, List<io.micrometer.core.instrument.Tag> tags)
    Create a io.micrometer.core.instrument.binder.kafka.KafkaMetrics instance for the provided Kafka client and metric tags.
    void
    streamsAdded(String id, org.apache.kafka.streams.KafkaStreams kafkaStreams)
    A new KafkaStreams was created.
    void
    streamsRemoved(String id, org.apache.kafka.streams.KafkaStreams streams)
    An existing KafkaStreams was removed.

    Methods inherited from class org.springframework.kafka.core.KafkaMetricsSupport

    bindClient, unbindClient

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KafkaStreamsMicrometerListener

      public KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Construct an instance with the provided registry.
      Parameters:
      meterRegistry - the registry.
    • KafkaStreamsMicrometerListener

      public KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry, org.springframework.scheduling.TaskScheduler taskScheduler)
      Construct an instance with the provided registry and task scheduler.
      Parameters:
      meterRegistry - the registry.
      taskScheduler - the task scheduler.
      Since:
      3.3
    • KafkaStreamsMicrometerListener

      public KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry, List<io.micrometer.core.instrument.Tag> tags)
      Construct an instance with the provided registry and tags.
      Parameters:
      meterRegistry - the registry.
      tags - the tags.
    • KafkaStreamsMicrometerListener

      public KafkaStreamsMicrometerListener(io.micrometer.core.instrument.MeterRegistry meterRegistry, List<io.micrometer.core.instrument.Tag> tags, org.springframework.scheduling.TaskScheduler taskScheduler)
      Construct an instance with the provided registry, tags and task scheduler.
      Parameters:
      meterRegistry - the registry.
      tags - the tags.
      taskScheduler - the task scheduler.
      Since:
      3.3
  • Method Details

    • streamsAdded

      public void streamsAdded(String id, org.apache.kafka.streams.KafkaStreams kafkaStreams)
      Description copied from interface: StreamsBuilderFactoryBean.Listener
      A new KafkaStreams was created.
      Specified by:
      streamsAdded in interface StreamsBuilderFactoryBean.Listener
      Parameters:
      id - the streams id (factory bean name).
      kafkaStreams - the streams;
    • createClientMetrics

      protected io.micrometer.core.instrument.binder.MeterBinder createClientMetrics(org.apache.kafka.streams.KafkaStreams client, List<io.micrometer.core.instrument.Tag> tags)
      Description copied from class: KafkaMetricsSupport
      Create a io.micrometer.core.instrument.binder.kafka.KafkaMetrics instance for the provided Kafka client and metric tags. By default, this factory is aware of Consumer, Producer and AdminClient types. For other use-case this method can be overridden.
      Overrides:
      createClientMetrics in class KafkaMetricsSupport<org.apache.kafka.streams.KafkaStreams>
      Parameters:
      client - the client to create a io.micrometer.core.instrument.binder.kafka.KafkaMetrics instance for.
      tags - the tags for the io.micrometer.core.instrument.binder.kafka.KafkaMetrics.
      Returns:
      the io.micrometer.core.instrument.binder.kafka.KafkaMetrics.
    • streamsRemoved

      public void streamsRemoved(String id, org.apache.kafka.streams.KafkaStreams streams)
      Description copied from interface: StreamsBuilderFactoryBean.Listener
      An existing KafkaStreams was removed.
      Specified by:
      streamsRemoved in interface StreamsBuilderFactoryBean.Listener
      Parameters:
      id - the streams id (factory bean name).
      streams - the streams;