Package io.opentelemetry.sdk.trace.data
Interface SpanData.Link
-
- Enclosing interface:
- SpanData
public static interface SpanData.LinkA link to aSpan.Used (for example) in batching operations, where a single batch handler processes multiple requests from different traces. Link can be also used to reference spans from the same trace.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description static SpanData.Linkcreate(io.opentelemetry.api.trace.SpanContext spanContext)Returns a new immutableLink.static SpanData.Linkcreate(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes)Returns a new immutableLink.static SpanData.Linkcreate(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes, int totalAttributeCount)Returns a new immutableLink.io.opentelemetry.api.common.AttributesgetAttributes()Returns the set of attributes.default io.opentelemetry.api.trace.SpanContextgetContext()Deprecated.UsegetSpanContext()io.opentelemetry.api.trace.SpanContextgetSpanContext()Returns theSpanContextof the span thisSpanData.Linkrefers to.intgetTotalAttributeCount()The total number of attributes that were recorded on this Link.
-
-
-
Method Detail
-
create
static SpanData.Link create(io.opentelemetry.api.trace.SpanContext spanContext)
Returns a new immutableLink.- Parameters:
spanContext- theSpanContextof thisLink.- Returns:
- a new immutable
Event<T>
-
create
static SpanData.Link create(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes)
Returns a new immutableLink.- Parameters:
spanContext- theSpanContextof thisLink.attributes- the attributes of thisLink.- Returns:
- a new immutable
Event<T>
-
create
static SpanData.Link create(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes, int totalAttributeCount)
Returns a new immutableLink.- Parameters:
spanContext- theSpanContextof thisLink.attributes- the attributes of thisLink.totalAttributeCount- the total number of attributed for thisLink.- Returns:
- a new immutable
Event<T>
-
getSpanContext
io.opentelemetry.api.trace.SpanContext getSpanContext()
Returns theSpanContextof the span thisSpanData.Linkrefers to.
-
getContext
@Deprecated default io.opentelemetry.api.trace.SpanContext getContext()
Deprecated.UsegetSpanContext()Returns theSpanContext.- Returns:
- the
SpanContext.
-
getAttributes
io.opentelemetry.api.common.Attributes getAttributes()
Returns the set of attributes.- Returns:
- the set of attributes.
-
getTotalAttributeCount
int getTotalAttributeCount()
The total number of attributes that were recorded on this Link. This number may be larger than the number of attributes that are attached to this span, if the total number recorded was greater than the configured maximum value. See:TraceConfig.getMaxNumberOfAttributesPerLink()- Returns:
- The number of attributes on this link.
-
-