Package io.micrometer.tracing.exporter
Interface FinishedSpan
public interface FinishedSpan
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).
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault FinishedSpan
Adds a link.default FinishedSpan
Adds links.default Duration
getError()
getKind()
getLinks()
default String
getName()
int
getTags()
Not all tracers (e.g.Sets the error.setEvents
(Collection<Map.Entry<Long, String>> events) Sets the events.setLocalIp
(String ip) Sets the local ip.Sets the name.setRemotePort
(int port) Sets the remote port.setRemoteServiceName
(String remoteServiceName) Sets the remote service name.Sets the tags.default FinishedSpan
setTypedTags
(Map<String, Object> tags) Sets the tags with typed values.
-
Method Details
-
setName
Sets the name.- Parameters:
name
- name to set- Returns:
- this
-
getName
String getName()- Returns:
- span's name
-
getStartTimestamp
Instant getStartTimestamp()- Returns:
- span's start timestamp
-
getEndTimestamp
Instant getEndTimestamp()- Returns:
- span's end timestamp
-
getDuration
- Returns:
- span's duration
- Since:
- 1.2.0
-
setTags
Sets the tags.- Parameters:
tags
- tags to set- Returns:
- this
-
getTags
- Returns:
- span's tags
-
setTypedTags
Sets the tags with typed values.- Parameters:
tags
- tags to set- Returns:
- this
- Since:
- 1.1.0
-
getTypedTags
Not all tracers (e.g. Brave) honor different values of tags in which case the tags will always get converted to String.- Returns:
- span's tags with typed values
- Since:
- 1.1.0
-
setEvents
Sets the events.- Parameters:
events
- events to set- Returns:
- this
-
getEvents
Collection<Map.Entry<Long,String>> getEvents()- Returns:
- span's events as timestamp to value mapping
-
getSpanId
String getSpanId()- Returns:
- span's span id
-
getParentId
- Returns:
- span's parent id or
null
if not set
-
getRemoteIp
- Returns:
- span's remote ip
-
getLocalIp
- Returns:
- span's local ip
-
setLocalIp
Sets the local ip.- Parameters:
ip
- ip to set- Returns:
- this
-
getRemotePort
int getRemotePort()- Returns:
- span's remote port
-
setRemotePort
Sets the remote port.- Parameters:
port
- port to set- Returns:
- this
-
getTraceId
String getTraceId()- Returns:
- span's trace id
-
getError
- Returns:
- corresponding error or
null
if one was not thrown
-
setError
Sets the error.- Parameters:
error
- error to set- Returns:
- this
-
getKind
Span.Kind getKind()- Returns:
- span's kind
-
getRemoteServiceName
- Returns:
- remote service name or
null
if not set
-
setRemoteServiceName
Sets the remote service name.- Parameters:
remoteServiceName
- remote service name- Returns:
- this
-
getLinks
- Returns:
- links
- Since:
- 1.1.0
-
addLinks
Adds links.- Parameters:
links
- links to add- Returns:
- this
- Since:
- 1.1.0
-
addLink
Adds a link.- Parameters:
link
- link to add- Returns:
- this
- Since:
- 1.1.0
-