Package io.opentelemetry.contrib.filter
Interface SpanFilter
- All Known Implementing Classes:
DurationSpanFilter,ErrorSpanFilter
public interface SpanFilter
A filter that evaluates individual spans to determine if their containing trace's spans (within
the same export batch) should be exported. Used by
FilteringSpanExporter to make per-span
keep/drop decisions.
If any SpanFilter returns true for any span in a batch, all spans sharing that
trace ID within the same batch are exported.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanshouldKeep(io.opentelemetry.sdk.trace.data.SpanData spanData) Evaluates whether the given span is interesting enough to keep its trace's spans in the batch.
-
Method Details
-
shouldKeep
boolean shouldKeep(io.opentelemetry.sdk.trace.data.SpanData spanData) Evaluates whether the given span is interesting enough to keep its trace's spans in the batch.- Parameters:
spanData- the span to evaluate- Returns:
trueif this span should cause its trace's batch-colocated spans to be exported
-