Top Description Fields Methods
io.micrometer.tracing

public Interface ScopedSpan


Represents the "current span" until ScopedSpan#end() ()} is called.
Authors
OpenZipkin Brave Authors, Marcin Grzejszczak
Since
1.0.0

Field Summary

Modifier and TypeField and Description
public static final ScopedSpan
NOOP

A noop implementation.

Method Summary

Modifier and TypeMethod and Description
public TraceContext

Returns:

TraceContext corresponding to this span.
context
()

public void
end()

Ends the span.

public ScopedSpan

Returns:

this span
error
(Throwable
to record
throwable
)

Records an exception for this span.

public ScopedSpan

Returns:

this span
event
(String
event name to set on the span
value
)

Sets an event on this span.

public boolean

Returns:

true when no recording is done and nothing is reported to an external system. However, this span should still be injected into outgoing requests. Use this flag to avoid performing expensive computation.
isNoop
()

public ScopedSpan

Returns:

this span
name
(String
name to set on the span
name
)

Sets a name on this span.

public ScopedSpan

Returns:

this span
tag
(String
tag key
key
,
String
tag value
value
)

Sets a tag on this span.

Field Detail

NOOPback to summary
public static final ScopedSpan NOOP

A noop implementation.

Method Detail

contextback to summary
public TraceContext context()
Returns:TraceContext

TraceContext corresponding to this span.

endback to summary
public void end()

Ends the span. The span gets stopped and recorded if not noop.

errorback to summary
public ScopedSpan error(Throwable throwable)

Records an exception for this span.

Parameters
throwable:Throwable

to record

Returns:ScopedSpan

this span

eventback to summary
public ScopedSpan event(String value)

Sets an event on this span.

Parameters
value:String

event name to set on the span

Returns:ScopedSpan

this span

isNoopback to summary
public boolean isNoop()
Returns:boolean

true when no recording is done and nothing is reported to an external system. However, this span should still be injected into outgoing requests. Use this flag to avoid performing expensive computation.

nameback to summary
public ScopedSpan name(String name)

Sets a name on this span.

Parameters
name:String

name to set on the span

Returns:ScopedSpan

this span

tagback to summary
public ScopedSpan tag(String key, String value)

Sets a tag on this span.

Parameters
key:String

tag key

value:String

tag value

Returns:ScopedSpan

this span