public final class CurrentSpanUtils
extends java.lang.Object
Span
in the Context
.Modifier and Type | Method and Description |
---|---|
static <C> java.util.concurrent.Callable<C> |
withSpan(io.opentelemetry.trace.Span span,
boolean endSpan,
java.util.concurrent.Callable<C> callable)
Wraps a
Callable so that it executes with the span as the current Span . |
static java.lang.Runnable |
withSpan(io.opentelemetry.trace.Span span,
boolean endSpan,
java.lang.Runnable runnable)
Wraps a
Runnable so that it executes with the span as the current Span . |
public static java.lang.Runnable withSpan(io.opentelemetry.trace.Span span, boolean endSpan, java.lang.Runnable runnable)
Runnable
so that it executes with the span
as the current Span
.span
- the Span
to be set as current.endSpan
- if true
the returned Runnable
will close the Span
.runnable
- the Runnable
to run in the Span
.Runnable
.public static <C> java.util.concurrent.Callable<C> withSpan(io.opentelemetry.trace.Span span, boolean endSpan, java.util.concurrent.Callable<C> callable)
Callable
so that it executes with the span
as the current Span
.C
- the Callable
result type.span
- the Span
to be set as current.endSpan
- if true
the returned Runnable
will close the Span
.callable
- the Callable
to run in the Span
.Callable
.