Package io.micrometer.tracing
Interface Span
- All Superinterfaces:
SpanCustomizer
This API was heavily influenced by Brave. Parts of its documentation were taken
directly from Brave.
Span is a single unit of work that needs to be started and stopped. Contains timing information and events and tags.
- Since:
- 1.0.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
In some cases (e.g.static enum
Type of span. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abandon()
Ends the span.context()
void
end()
Ends the span.void
Ends the span.Records an exception for this span.Sets an event on this span.Sets an event on this span.boolean
isNoop()
Sets a name on this span.remoteIpAndPort
(String ip, int port) Sets the remote url on the span.remoteServiceName
(String remoteServiceName) Sets the remote service name for the span.start()
Starts this span.Sets a tag on this span.
-
Field Details
-
NOOP
A noop implementation.
-
-
Method Details
-
isNoop
boolean isNoop()- 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.
-
context
TraceContext context()- Returns:
TraceContext
corresponding to this span.
-
start
Span start()Starts this span.- Returns:
- this span
-
name
Sets a name on this span.- Specified by:
name
in interfaceSpanCustomizer
- Parameters:
name
- name to set on the span- Returns:
- this span
-
event
Sets an event on this span.- Specified by:
event
in interfaceSpanCustomizer
- Parameters:
value
- event name to set on the span- Returns:
- this span
-
event
Sets an event on this span.- Parameters:
value
- event name to set on the spantime
- timestamp of the eventtimeUnit
- timestamp's time unit- Returns:
- this span
-
tag
Sets a tag on this span.- Specified by:
tag
in interfaceSpanCustomizer
- Parameters:
key
- tag keyvalue
- tag value- Returns:
- this span
-
error
Records an exception for this span.- Parameters:
throwable
- to record- Returns:
- this span
-
end
void end()Ends the span. The span gets stopped and recorded if not noop. -
end
Ends the span. The span gets stopped and recorded if not noop.- Parameters:
time
- timestamptimeUnit
- time unit of the timestamp
-
abandon
void abandon()Ends the span. The span gets stopped but does not get recorded. -
remoteServiceName
Sets the remote service name for the span.- Parameters:
remoteServiceName
- remote service name- Returns:
- this span
-
remoteIpAndPort
Sets the remote url on the span.- Parameters:
ip
- remote ipport
- remote port- Returns:
- this span
- Since:
- 1.0.0
-