Class EventLogger

java.lang.Object
io.confluent.telemetry.events.EventLogger
All Implemented Interfaces:
AutoCloseable, org.apache.kafka.common.Configurable, org.apache.kafka.common.Reconfigurable

public class EventLogger extends Object implements org.apache.kafka.common.Reconfigurable, AutoCloseable
This creates a logger that writes events to the configured exporter.
  • Constructor Details

  • Method Details

    • log

      public void log(io.confluent.telemetry.api.events.Event event)
      Log an event. This method might block if the exporter is not ready yet. If you need non-blocking behavior then you should use the ready(..) method to ensure the exporter is ready before sending events.
      Parameters:
      event -
    • logAndGetFuture

      public CompletableFuture<Boolean> logAndGetFuture(io.confluent.telemetry.api.events.Event event)
      Log an event and return the future
      Parameters:
      event -
      Returns:
      the future
    • ready

      public boolean ready(io.confluent.telemetry.api.events.Event event)
      Check if the event exporter ready for sending events. This method does not block.
    • reconfigurableConfigs

      public Set<String> reconfigurableConfigs()
      Specified by:
      reconfigurableConfigs in interface org.apache.kafka.common.Reconfigurable
    • validateReconfiguration

      public void validateReconfiguration(Map<String,?> configs) throws org.apache.kafka.common.config.ConfigException
      Specified by:
      validateReconfiguration in interface org.apache.kafka.common.Reconfigurable
      Throws:
      org.apache.kafka.common.config.ConfigException
    • reconfigure

      public void reconfigure(Map<String,?> configs)
      Specified by:
      reconfigure in interface org.apache.kafka.common.Reconfigurable
    • configure

      public void configure(Map<String,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • eventExporter

      public Exporter<io.confluent.telemetry.api.events.Event> eventExporter()