Top Description Methods
io.micrometer.tracing.exporter

public Interface FinishedSpan

Imports
java.time.Duration, .Instant, java.util.Collection, .Collections, .HashMap, .List, .Map, io.micrometer.common.lang.Nullable, io.micrometer.tracing.Link, .Span

This API is inspired by OpenZipkin Brave (from {code MutableSpan}). Represents a span that has been finished and is ready to be sent to an external location (e.g. Zipkin).
Authors
OpenZipkin Brave Authors, Marcin Grzejszczak, Yanming Zhou
Since
1.0.0

Method Summary

Modifier and TypeMethod and Description
public default Duration

Returns:

span's duration
getDuration
()

public Instant

Returns:

span's end timestamp
getEndTimestamp
()

public Throwable

Returns:

corresponding error or null if one was not thrown
getError
()

public Collection<Map.Entry<Long, String>>

Returns:

span's events as timestamp to value mapping
getEvents
()

public Span.Kind

Returns:

span's kind
getKind
()

public default String

Returns:

span's local ip
getLocalIp
()

public String

Returns:

span's name
getName
()

public String

Returns:

span's parent id or null if not set
getParentId
()

public String

Returns:

span's remote ip
getRemoteIp
()

public int

Returns:

span's remote port
getRemotePort
()

public String

Returns:

remote service name or null if not set
getRemoteServiceName
()

public String

Returns:

span's span id
getSpanId
()

public Instant

Returns:

span's start timestamp
getStartTimestamp
()

public Map<String, String>

Returns:

span's tags
getTags
()

public String

Returns:

span's trace id
getTraceId
()

public default Map<String, Object>

Returns:

span's tags with typed values
getTypedTags
()

Not all tracers (e.g. Brave) honor different values of tags in which case the tags will always get converted to String.

public FinishedSpan

Returns:

this
setError
(Throwable
error to set
error
)

Sets the error.

public FinishedSpan

Returns:

this
setEvents
(Collection<Map.Entry<Long, String>>
events to set
events
)

Sets the events.

public FinishedSpan

Returns:

this
setLocalIp
(String
ip to set
ip
)

Sets the local ip.

public FinishedSpan

Returns:

this
setName
(String
name to set
name
)

Sets the name.

public FinishedSpan

Returns:

this
setRemotePort
(int
port to set
port
)

Sets the remote port.

public FinishedSpan

Returns:

this
setRemoteServiceName
(String
remote service name
remoteServiceName
)

Sets the remote service name.

public FinishedSpan

Returns:

this
setTags
(Map<String, String>
tags to set
tags
)

Sets the tags.

public default FinishedSpan

Returns:

this
setTypedTags
(Map<String, Object>
tags to set
tags
)

Sets the tags with typed values.

Method Detail

getDurationback to summary
public default Duration getDuration()
Returns:Duration

span's duration

Since
1.2.0
getEndTimestampback to summary
public Instant getEndTimestamp()
Returns:Instant

span's end timestamp

getErrorback to summary
public Throwable getError()
Returns:Throwable

corresponding error or null if one was not thrown

Annotations
@Nullable
getEventsback to summary
public Collection<Map.Entry<Long, String>> getEvents()
Returns:Collection<Map.Entry<Long, String>>

span's events as timestamp to value mapping

getKindback to summary
public Span.Kind getKind()
Returns:Span.Kind

span's kind

getLocalIpback to summary
public default String getLocalIp()
Returns:String

span's local ip

Annotations
@Nullable
getNameback to summary
public String getName()
Returns:String

span's name

getParentIdback to summary
public String getParentId()
Returns:String

span's parent id or null if not set

Annotations
@Nullable
getRemoteIpback to summary
public String getRemoteIp()
Returns:String

span's remote ip

Annotations
@Nullable
getRemotePortback to summary
public int getRemotePort()
Returns:int

span's remote port

getRemoteServiceNameback to summary
public String getRemoteServiceName()
Returns:String

remote service name or null if not set

Annotations
@Nullable
getSpanIdback to summary
public String getSpanId()
Returns:String

span's span id

getStartTimestampback to summary
public Instant getStartTimestamp()
Returns:Instant

span's start timestamp

getTagsback to summary
public Map<String, String> getTags()
Returns:Map<String, String>

span's tags

getTraceIdback to summary
public String getTraceId()
Returns:String

span's trace id

getTypedTagsback to summary
public default Map<String, Object> getTypedTags()

Not all tracers (e.g. Brave) honor different values of tags in which case the tags will always get converted to String.

Returns:Map<String, Object>

span's tags with typed values

Since
1.1.0
setErrorback to summary
public FinishedSpan setError(Throwable error)

Sets the error.

Parameters
error:Throwable

error to set

Returns:FinishedSpan

this

setEventsback to summary
public FinishedSpan setEvents(Collection<Map.Entry<Long, String>> events)

Sets the events.

Parameters
events:Collection<Map.Entry<Long, String>>

events to set

Returns:FinishedSpan

this

setLocalIpback to summary
public FinishedSpan setLocalIp(String ip)

Sets the local ip.

Parameters
ip:String

ip to set

Returns:FinishedSpan

this

setNameback to summary
public FinishedSpan setName(String name)

Sets the name.

Parameters
name:String

name to set

Returns:FinishedSpan

this

setRemotePortback to summary
public FinishedSpan setRemotePort(int port)

Sets the remote port.

Parameters
port:int

port to set

Returns:FinishedSpan

this

setRemoteServiceNameback to summary
public FinishedSpan setRemoteServiceName(String remoteServiceName)

Sets the remote service name.

Parameters
remoteServiceName:String

remote service name

Returns:FinishedSpan

this

setTagsback to summary
public FinishedSpan setTags(Map<String, String> tags)

Sets the tags.

Parameters
tags:Map<String, String>

tags to set

Returns:FinishedSpan

this

setTypedTagsback to summary
public default FinishedSpan setTypedTags(Map<String, Object> tags)

Sets the tags with typed values.

Parameters
tags:Map<String, Object>

tags to set

Returns:FinishedSpan

this

Since
1.1.0