Class ApacheHttpSink.Builder

java.lang.Object
com.arpnetworking.metrics.impl.ApacheHttpSink.Builder
Enclosing class:
ApacheHttpSink

public static final class ApacheHttpSink.Builder extends Object
Builder for ApacheHttpSink.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot io), Ville Koskela (ville dot koskela at inscopemetrics dot io)
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setBufferSize

      public ApacheHttpSink.Builder setBufferSize(@Nullable Integer value)
      Set the buffer size in number of events. Optional; default is 10,000.
      Parameters:
      value - The number of events to buffer.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setUri

      public ApacheHttpSink.Builder setUri(@Nullable URI value)
      Set the URI of the HTTP endpoint. Optional; default is http://localhost:7090/metrics/v3/application.
      Parameters:
      value - The uri of the HTTP endpoint.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setParallelism

      public ApacheHttpSink.Builder setParallelism(@Nullable Integer value)
      Set the parallelism (threads and connections) that the sink will use. Optional; default is 5.
      Parameters:
      value - The uri of the HTTP endpoint.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setEmptyQueueInterval

      public ApacheHttpSink.Builder setEmptyQueueInterval(@Nullable Duration value)
      Set the empty queue interval. Each worker thread will independently sleep this long if the event queue is empty. Optional; default is 500 milliseconds.
      Parameters:
      value - The empty queue interval.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setMaxBatchSize

      public ApacheHttpSink.Builder setMaxBatchSize(@Nullable Integer value)
      Set the maximum batch size (records to send in each request). Optional; default is 500.
      Parameters:
      value - The maximum batch size.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setEventsDroppedLoggingInteval

      public ApacheHttpSink.Builder setEventsDroppedLoggingInteval(@Nullable Duration value)
      Set the events dropped logging interval. Any event drop notices will be logged at most once per interval. Optional; default is 1 minute.
      Parameters:
      value - The logging interval.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setDispatchErrorLoggingInterval

      public ApacheHttpSink.Builder setDispatchErrorLoggingInterval(@Nullable Duration value)
      Set the dispatch error logging interval. Any dispatch errors will be logged at most once per interval. Optional; default is 1 minute.
      Parameters:
      value - The logging interval.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setUnsupportedDataLoggingInterval

      public ApacheHttpSink.Builder setUnsupportedDataLoggingInterval(@Nullable Duration value)
      Set the unsupported data logging interval. Any unsupported data errors will be logged at most once per interval. Optional; default is 1 minute.
      Parameters:
      value - The logging interval.
      Returns:
      This ApacheHttpSink.Builder instance.
    • setEventHandler

      public ApacheHttpSink.Builder setEventHandler(@Nullable ApacheHttpSinkEventHandler value)
      Set the event handler. Optional; default is null.
      Parameters:
      value - The event handler.
      Returns:
      This ApacheHttpSink.Builder instance.
    • build

      public com.arpnetworking.metrics.Sink build()
      Create an instance of Sink.
      Returns:
      Instance of Sink.