@Immutable public abstract class Link extends Object
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
Link.Type
The relationship with the linked
Span relative to the current Span. |
| Modifier and Type | Method and Description |
|---|---|
static Link |
fromSpanContext(SpanContext context,
Link.Type type)
Returns a new
Link. |
static Link |
fromSpanContext(SpanContext context,
Link.Type type,
Map<String,AttributeValue> attributes)
Returns a new
Link. |
abstract Map<String,AttributeValue> |
getAttributes()
Returns the set of attributes.
|
abstract SpanId |
getSpanId()
Returns the
SpanId. |
abstract TraceId |
getTraceId()
Returns the
TraceId. |
abstract Link.Type |
getType()
Returns the
Type. |
public static Link fromSpanContext(SpanContext context, Link.Type type)
Link.context - the context of the linked Span.type - the type of the relationship with the linked Span.Link.public static Link fromSpanContext(SpanContext context, Link.Type type, Map<String,AttributeValue> attributes)
Link.context - the context of the linked Span.type - the type of the relationship with the linked Span.attributes - the attributes of the Link.Link.public abstract TraceId getTraceId()
TraceId.TraceId.public abstract SpanId getSpanId()
SpanId.SpanIdpublic abstract Link.Type getType()
Type.Type.public abstract Map<String,AttributeValue> getAttributes()