|
|
@ -17,18 +17,22 @@
|
|
|
|
package org.springframework.boot.actuate.autoconfigure.tracing;
|
|
|
|
package org.springframework.boot.actuate.autoconfigure.tracing;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Spliterator;
|
|
|
|
import java.util.Spliterator;
|
|
|
|
|
|
|
|
|
|
|
|
import io.opentelemetry.sdk.trace.SpanProcessor;
|
|
|
|
import io.opentelemetry.sdk.trace.SpanProcessor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* A collection of {@link SpanProcessor span processors}.
|
|
|
|
* A collection of {@link SpanProcessor span processors}.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Moritz Halbritter
|
|
|
|
* @author Moritz Halbritter
|
|
|
|
* @since 3.2.0
|
|
|
|
* @since 3.2.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
@FunctionalInterface
|
|
|
|
public interface SpanProcessors extends Iterable<SpanProcessor> {
|
|
|
|
public interface SpanProcessors extends Iterable<SpanProcessor> {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -47,16 +51,6 @@ public interface SpanProcessors extends Iterable<SpanProcessor> {
|
|
|
|
return list().spliterator();
|
|
|
|
return list().spliterator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Constructs a {@link SpanProcessors} instance with the given list of
|
|
|
|
|
|
|
|
* {@link SpanProcessor span processors}.
|
|
|
|
|
|
|
|
* @param spanProcessors the list of span processors
|
|
|
|
|
|
|
|
* @return the constructed {@link SpanProcessors} instance
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
static SpanProcessors of(List<SpanProcessor> spanProcessors) {
|
|
|
|
|
|
|
|
return () -> spanProcessors;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Constructs a {@link SpanProcessors} instance with the given {@link SpanProcessor
|
|
|
|
* Constructs a {@link SpanProcessors} instance with the given {@link SpanProcessor
|
|
|
|
* span processors}.
|
|
|
|
* span processors}.
|
|
|
@ -67,4 +61,16 @@ public interface SpanProcessors extends Iterable<SpanProcessor> {
|
|
|
|
return of(Arrays.asList(spanProcessors));
|
|
|
|
return of(Arrays.asList(spanProcessors));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Constructs a {@link SpanProcessors} instance with the given list of
|
|
|
|
|
|
|
|
* {@link SpanProcessor span processors}.
|
|
|
|
|
|
|
|
* @param spanProcessors the list of span processors
|
|
|
|
|
|
|
|
* @return the constructed {@link SpanProcessors} instance
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
static SpanProcessors of(Collection<? extends SpanProcessor> spanProcessors) {
|
|
|
|
|
|
|
|
Assert.notNull(spanProcessors, "SpanProcessors must not be null");
|
|
|
|
|
|
|
|
List<SpanProcessor> copy = List.copyOf(spanProcessors);
|
|
|
|
|
|
|
|
return () -> copy;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|