File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
span-stacktrace/src/main/java/io/opentelemetry/contrib/stacktrace Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ public void customize(AutoConfigurationCustomizer config) {
3434 config .addTracerProviderCustomizer (
3535 (providerBuilder , properties ) -> {
3636 long minDuration = getMinDuration (properties );
37- Predicate <ReadableSpan > filter = getFilterPredicate (properties );
38- providerBuilder .addSpanProcessor (new StackTraceSpanProcessor (minDuration , filter ));
37+ if (minDuration >= 0 ) {
38+ Predicate <ReadableSpan > filter = getFilterPredicate (properties );
39+ providerBuilder .addSpanProcessor (new StackTraceSpanProcessor (minDuration , filter ));
40+ }
3941 return providerBuilder ;
4042 });
4143 }
Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ public class StackTraceSpanProcessor implements ExtendedSpanProcessor {
3030 */
3131 public StackTraceSpanProcessor (
3232 long minSpanDurationNanos , Predicate <ReadableSpan > filterPredicate ) {
33+ if (minSpanDurationNanos < 0 ) {
34+ throw new IllegalArgumentException ("minimal span duration must be positive or zero" );
35+ }
36+
3337 this .minSpanDurationNanos = minSpanDurationNanos ;
3438 this .filterPredicate = filterPredicate ;
3539 }
You can’t perform that action at this time.
0 commit comments