Interface TraceFilter

All Known Implementing Classes:
TraceDurationFilter

public interface TraceFilter
A filter that evaluates all spans belonging to a single trace within an export batch to determine if those spans should be exported. Used by FilteringSpanExporter for decisions that require batch-level context (e.g., overall trace wall-clock duration).

If any TraceFilter returns true for a trace, all spans sharing that trace ID within the same batch are exported.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    shouldKeep(String traceId, Collection<io.opentelemetry.sdk.trace.data.SpanData> spans)
    Evaluates whether the given trace (represented as all spans sharing a trace ID within the current batch) should be exported.
  • Method Details

    • shouldKeep

      boolean shouldKeep(String traceId, Collection<io.opentelemetry.sdk.trace.data.SpanData> spans)
      Evaluates whether the given trace (represented as all spans sharing a trace ID within the current batch) should be exported.
      Parameters:
      traceId - the trace ID
      spans - all spans in the current batch belonging to this trace
      Returns:
      true if this trace should be exported