Package io.opentelemetry.contrib.filter
Class TraceDurationFilter
java.lang.Object
io.opentelemetry.contrib.filter.TraceDurationFilter
- All Implemented Interfaces:
TraceFilter
A
TraceFilter that matches when the wall-clock duration (max end - min start across all
spans in the batch sharing a trace ID) exceeds a configurable threshold.-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
TraceDurationFilter
Creates a newTraceDurationFilter.- Parameters:
threshold- the trace duration threshold; traces with wall-clock duration strictly greater than this are considered interesting
-
-
Method Details
-
shouldKeep
public boolean shouldKeep(String traceId, Collection<io.opentelemetry.sdk.trace.data.SpanData> spans) Description copied from interface:TraceFilterEvaluates whether the given trace (represented as all spans sharing a trace ID within the current batch) should be exported.- Specified by:
shouldKeepin interfaceTraceFilter- Parameters:
traceId- the trace IDspans- all spans in the current batch belonging to this trace- Returns:
trueif this trace should be exported
-