Class CurrentSpanUtils
java.lang.Object
io.opencensus.trace.CurrentSpanUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final classprivate static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static SpanReturns TheSpanfrom the current context.private static voidsetErrorStatus(Span span, Throwable t) (package private) static ScopeEnters the scope of code where the givenSpanis in the current context, and returns an object that represents that scope.(package private) static Runnable(package private) static <C> Callable<C>
-
Constructor Details
-
CurrentSpanUtils
private CurrentSpanUtils()
-
-
Method Details
-
getCurrentSpan
-
withSpan
Enters the scope of code where the givenSpanis in the current context, and returns an object that represents that scope. The scope is exited when the returned object is closed.Supports try-with-resource idiom.
- Parameters:
span- TheSpanto be set to the current context.endSpan- iftruethe returnedScopewill close theSpan.- Returns:
- An object that defines a scope where the given
Spanis set to the current context.
-
withSpan
- Parameters:
span- theSpanto be set as current.endSpan- iftruethe returnedRunnablewill close theSpan.runnable- theRunnableto run in theSpan.- Returns:
- the wrapped
Runnable.
-
withSpan
- Parameters:
span- theSpanto be set as current.endSpan- iftruethe returnedRunnablewill close theSpan.callable- theCallableto run in theSpan.- Returns:
- the wrapped
Callable.
-
setErrorStatus
-