Class PipelineConfig


  • public class PipelineConfig
    extends java.lang.Object
    Configuration properties for Loki4j pipeline
    • Field Detail

      • defaultHttpClientFactory

        public static final java.util.function.Function<HttpConfig,​Loki4jHttpClient> defaultHttpClientFactory
      • name

        public final java.lang.String name
        Name of this pipeline
      • batchMaxItems

        public final int batchMaxItems
        Max number of events to put into a single batch before sending it to Loki
      • batchMaxBytes

        public final int batchMaxBytes
        Max number of bytes a single batch can contain (as counted by Loki). This value should not be greater than server.grpc_server_max_recv_msg_size in your Loki config
      • batchTimeoutMs

        public final long batchTimeoutMs
        Max time in milliseconds to keep a batch before sending it to Loki, even if max items/bytes limits for this batch are not reached
      • sortByTime

        public final boolean sortByTime
        If true, log records in batch are sorted by timestamp. If false, records will be sent to Loki in arrival order. Turn this on if you see 'entry out of order' error from Loki.
      • staticLabels

        public final boolean staticLabels
        If you use only one label for all log records, you can set this flag to true and save some CPU time on grouping records by label.
      • sendQueueMaxBytes

        public final long sendQueueMaxBytes
        Max number of bytes to keep in the send queue. When the queue is full, incoming log events are dropped
      • useDirectBuffers

        public final boolean useDirectBuffers
        Use off-heap memory for storing intermediate data
      • drainOnStop

        public final boolean drainOnStop
        If true, the pipeline will try to send all the remaining events on shutdown, so the proper shutdown procedure might take longer. Otherwise, the pipeline will drop the unsent events
      • metricsEnabled

        public final boolean metricsEnabled
        If true, the pipeline will report its metrics using Micrometer
      • httpConfig

        public final HttpConfig httpConfig
        Configuration properties for HTTP clients
      • httpClientFactory

        public final java.util.function.Function<HttpConfig,​Loki4jHttpClient> httpClientFactory
        A factory for HTTP client for sending logs to Loki. Argument is a config required for constructing an HTTP client
      • internalLoggingFactory

        public final java.util.function.Function<java.lang.Object,​Loki4jLogger> internalLoggingFactory
        A factory for an internal logger. Argument is a source class to report log messages from
    • Constructor Detail

      • PipelineConfig

        public PipelineConfig​(java.lang.String name,
                              int batchMaxItems,
                              int batchMaxBytes,
                              long batchTimeoutMs,
                              boolean sortByTime,
                              boolean staticLabels,
                              long sendQueueMaxBytes,
                              boolean useDirectBuffers,
                              boolean drainOnStop,
                              boolean metricsEnabled,
                              PipelineConfig.WriterFactory writerFactory,
                              HttpConfig httpConfig,
                              java.util.function.Function<HttpConfig,​Loki4jHttpClient> httpClientFactory,
                              java.util.function.Function<java.lang.Object,​Loki4jLogger> internalLoggingFactory)