Package io.opencensus.trace
Class Link
java.lang.Object
io.opencensus.trace.Link
- Direct Known Subclasses:
AutoValue_Link
A link to a
Span
from a different trace.
It requires a Link.Type
which describes the relationship with the linked Span
and
the identifiers of the linked Span
.
Used (for example) in batching operations, where a single batch handler processes multiple requests from different traces.
- Since:
- 0.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The relationship with the linkedSpan
relative to the currentSpan
. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Link
fromSpanContext
(SpanContext context, Link.Type type) Returns a newLink
.static Link
fromSpanContext
(SpanContext context, Link.Type type, Map<String, AttributeValue> attributes) Returns a newLink
.abstract Map
<String, AttributeValue> Returns the set of attributes.abstract SpanId
Returns theSpanId
.abstract TraceId
Returns theTraceId
.abstract Link.Type
getType()
Returns theType
.
-
Field Details
-
EMPTY_ATTRIBUTES
-
-
Constructor Details
-
Link
Link()
-
-
Method Details
-
fromSpanContext
Returns a newLink
.- Parameters:
context
- the context of the linkedSpan
.type
- the type of the relationship with the linkedSpan
.- Returns:
- a new
Link
. - Since:
- 0.5
-
fromSpanContext
public static Link fromSpanContext(SpanContext context, Link.Type type, Map<String, AttributeValue> attributes) Returns a newLink
.- Parameters:
context
- the context of the linkedSpan
.type
- the type of the relationship with the linkedSpan
.attributes
- the attributes of theLink
.- Returns:
- a new
Link
. - Since:
- 0.5
-
getTraceId
Returns theTraceId
.- Returns:
- the
TraceId
. - Since:
- 0.5
-
getSpanId
Returns theSpanId
.- Returns:
- the
SpanId
- Since:
- 0.5
-
getType
Returns theType
.- Returns:
- the
Type
. - Since:
- 0.5
-
getAttributes
Returns the set of attributes.- Returns:
- the set of attributes.
- Since:
- 0.5
-