public interface TraceStrategy
| Modifier and Type | Method and Description |
|---|---|
void |
endScope(Closeable scope,
Throwable throwable)
Ends the current span with a status derived from the given (optional) Throwable, and closes the
given scope.
|
Closeable |
startScopedSpan(String spanName)
Starts a new span and sets it as the current span.
|
@MustBeClosed Closeable startScopedSpan(String spanName)
Enters the scope of code where the newly created Span is in the current Context, and
returns an object that represents that scope. When the returned object is closed, the scope is
exited, the previous Context is restored, and the newly created Span is ended using
Span.end(io.opencensus.trace.EndSpanOptions).
Callers must eventually close the returned object to avoid leaking the Context.
Supports the try-with-resource idiom.
NB: The return type of this method is intentionally Closeable and not the more
specific Scope because the latter would not be visible from
classes loaded by the bootstrap classloader.
spanName - the name of the returned SpanSpan will be set to the
current ContextTracer.spanBuilder(java.lang.String),
SpanBuilder.startScopedSpan()