Top Description Fields Constructors Methods
io.micrometer.tracing

public Class SpanAndScope

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.Closeable, io.micrometer.common.util.internal.logging.InternalLogger, .InternalLoggerFactory, io.micrometer.common.lang.Nullable

Container object for Span and its corresponding Tracer.SpanInScope.
Authors
Marcin Grzejszczak, Arthur Gavlyukovskiy
Since
1.0.0

Field Summary

Modifier and TypeField and Description
private static final InternalLogger
private final Tracer.SpanInScope
private final Span

Constructor Summary

AccessConstructor and Description
public
SpanAndScope(Span
span
span
,
Tracer.SpanInScope
scope
scope
)

Creates a new span and scope

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public Tracer.SpanInScope

Returns:

scope
getScope
()

Gets the scope.

public Span

Returns:

span
getSpan
()

Gets the span.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

logback to summary
private static final InternalLogger log
scopeback to summary
private final Tracer.SpanInScope scope
spanback to summary
private final Span span

Constructor Detail

SpanAndScopeback to summary
public SpanAndScope(Span span, Tracer.SpanInScope scope)

Creates a new span and scope

Parameters
span:Span

span

scope:Tracer.SpanInScope

scope

Method Detail

closeback to summary
public void close()

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
getScopeback to summary
public Tracer.SpanInScope getScope()

Gets the scope.

Returns:Tracer.SpanInScope

scope

Annotations
@Nullable
getSpanback to summary
public Span getSpan()

Gets the span.

Returns:Span

span

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override