Class LiveTailOptions

java.lang.Object
codes.grow.packages.loki.LiveTailOptions

public final class LiveTailOptions extends Object
  • Method Details

    • defaults

      public static LiveTailOptions defaults()
      Default options: Loki replays the last hour (up to 100 entries), then streams new entries.
      Returns:
      the options
    • builder

      public static LiveTailOptions.Builder builder()
      Starts a builder.
      Returns:
      a new builder
    • start

      public Optional<Instant> start()
      Returns the replay start.
      Returns:
      start, or empty (live only: the tail starts at the connection time; without a start Loki itself would replay the last hour)
    • limit

      public OptionalInt limit()
      Returns the maximum number of replayed entries.
      Returns:
      limit, or empty (Loki default 100)
    • delayFor

      public Optional<Duration> delayFor()
      Returns the server-side delay.
      Returns:
      delay (0–5 s, sent as whole seconds), or empty
    • onDropped

      public Consumer<List<DroppedEntry>> onDropped()
      Returns the callback for entries the server dropped because the client fell behind.
      Returns:
      the callback (never null)
    • onError

      public Consumer<LokiException> onError()
      Returns the callback for errors after the connection was established (bad frame, abnormal close).
      Returns:
      the callback (never null)