Interface LinkData


@Immutable public interface LinkData
Data representation of a link.

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

    Modifier and Type
    Method
    Description
    static LinkData
    create(io.opentelemetry.api.trace.SpanContext spanContext)
    Returns a new immutable LinkData.
    static LinkData
    create(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes)
    Returns a new immutable LinkData.
    static LinkData
    create(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes, int totalAttributeCount)
    Returns a new immutable LinkData.
    io.opentelemetry.api.common.Attributes
    Returns the set of attributes.
    io.opentelemetry.api.trace.SpanContext
    Returns the SpanContext of the span this LinkData refers to.
    int
    The total number of attributes that were recorded on this Link.
  • Method Details

    • create

      static LinkData create(io.opentelemetry.api.trace.SpanContext spanContext)
      Returns a new immutable LinkData.
      Parameters:
      spanContext - the SpanContext of this LinkData.
      Returns:
      a new immutable LinkData
    • create

      static LinkData create(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes)
      Returns a new immutable LinkData.
      Parameters:
      spanContext - the SpanContext of this LinkData.
      attributes - the attributes of this LinkData.
      Returns:
      a new immutable LinkData
    • create

      static LinkData create(io.opentelemetry.api.trace.SpanContext spanContext, io.opentelemetry.api.common.Attributes attributes, int totalAttributeCount)
      Returns a new immutable LinkData.
      Parameters:
      spanContext - the SpanContext of this LinkData.
      attributes - the attributes of this LinkData.
      totalAttributeCount - the total number of attributed for this LinkData.
      Returns:
      a new immutable LinkData
    • getSpanContext

      io.opentelemetry.api.trace.SpanContext getSpanContext()
      Returns the SpanContext of the span this LinkData refers to.
    • 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: SpanLimits.getMaxNumberOfAttributesPerLink()
      Returns:
      The number of attributes on this link.