Class Link

  • Direct Known Subclasses:
    AutoValue_Link

    @Immutable
    public abstract class Link
    extends java.lang.Object
    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
    • Field Detail

      • EMPTY_ATTRIBUTES

        private static final java.util.Map<java.lang.String,​AttributeValue> EMPTY_ATTRIBUTES
    • Constructor Detail

      • Link

        Link()
    • Method Detail

      • fromSpanContext

        public static Link fromSpanContext​(SpanContext context,
                                           Link.Type type)
        Returns a new Link.
        Parameters:
        context - the context of the linked Span.
        type - the type of the relationship with the linked Span.
        Returns:
        a new Link.
        Since:
        0.5
      • fromSpanContext

        public static Link fromSpanContext​(SpanContext context,
                                           Link.Type type,
                                           java.util.Map<java.lang.String,​AttributeValue> attributes)
        Returns a new Link.
        Parameters:
        context - the context of the linked Span.
        type - the type of the relationship with the linked Span.
        attributes - the attributes of the Link.
        Returns:
        a new Link.
        Since:
        0.5
      • getTraceId

        public abstract TraceId getTraceId()
        Returns the TraceId.
        Returns:
        the TraceId.
        Since:
        0.5
      • getSpanId

        public abstract SpanId getSpanId()
        Returns the SpanId.
        Returns:
        the SpanId
        Since:
        0.5
      • getType

        public abstract Link.Type getType()
        Returns the Type.
        Returns:
        the Type.
        Since:
        0.5
      • getAttributes

        public abstract java.util.Map<java.lang.String,​AttributeValue> getAttributes()
        Returns the set of attributes.
        Returns:
        the set of attributes.
        Since:
        0.5