Libraries
    Preparing search index...

    Function samplingFilter

    • Creates a sampling filter for high-throughput scenarios.

      Only a fraction of events at the specified levels are kept, reducing log volume without losing visibility at higher severity levels.

      Parameters

      Returns LogFilter

      a LogFilter that randomly samples events

      const filter = samplingFilter({ debug: 0.01, trace: 0.001 });
      // Keeps 1% of debug events, 0.1% of trace events