Package io.opentelemetry.contrib.filter
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 TypeMethodDescriptionbooleanshouldKeep(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
Evaluates whether the given trace (represented as all spans sharing a trace ID within the current batch) should be exported.- Parameters:
traceId- the trace IDspans- all spans in the current batch belonging to this trace- Returns:
trueif this trace should be exported
-