Class ErrorSpanFilter

java.lang.Object
io.opentelemetry.contrib.filter.ErrorSpanFilter
All Implemented Interfaces:
SpanFilter

public final class ErrorSpanFilter extends Object implements SpanFilter
A SpanFilter that matches spans with StatusCode.ERROR, causing all batch-colocated spans sharing the same trace ID to be exported.
  • Constructor Details

    • ErrorSpanFilter

      public ErrorSpanFilter()
  • Method Details

    • shouldKeep

      public boolean shouldKeep(io.opentelemetry.sdk.trace.data.SpanData spanData)
      Description copied from interface: SpanFilter
      Evaluates whether the given span is interesting enough to keep its trace's spans in the batch.
      Specified by:
      shouldKeep in interface SpanFilter
      Parameters:
      spanData - the span to evaluate
      Returns:
      true if this span should cause its trace's batch-colocated spans to be exported