Class SpanData

  • Direct Known Subclasses:
    AutoValue_SpanData

    @Immutable
    public abstract class SpanData
    extends java.lang.Object
    Immutable representation of all data collected by the Span class.
    Since:
    0.5
    • Constructor Detail

      • SpanData

        SpanData()
    • Method Detail

      • create

        public static SpanData create​(SpanContext context,
                                      @Nullable
                                      SpanId parentSpanId,
                                      @Nullable
                                      java.lang.Boolean hasRemoteParent,
                                      java.lang.String name,
                                      @Nullable
                                      Span.Kind kind,
                                      Timestamp startTimestamp,
                                      SpanData.Attributes attributes,
                                      SpanData.TimedEvents<Annotation> annotations,
                                      SpanData.TimedEvents<? extends BaseMessageEvent> messageOrNetworkEvents,
                                      SpanData.Links links,
                                      @Nullable
                                      java.lang.Integer childSpanCount,
                                      @Nullable
                                      Status status,
                                      @Nullable
                                      Timestamp endTimestamp)
        Returns a new immutable SpanData.
        Parameters:
        context - the SpanContext of the Span.
        parentSpanId - the parent SpanId of the Span. null if the Span is a root.
        hasRemoteParent - true if the parent Span is remote. null if this is a root span.
        name - the name of the Span.
        kind - the kind of the Span.
        startTimestamp - the start Timestamp of the Span.
        attributes - the attributes associated with the Span.
        annotations - the annotations associated with the Span.
        messageOrNetworkEvents - the message events (or network events for backward compatibility) associated with the Span.
        links - the links associated with the Span.
        childSpanCount - the number of child spans that were generated while the span was active.
        status - the Status of the Span. null if the Span is still active.
        endTimestamp - the end Timestamp of the Span. null if the Span is still active.
        Returns:
        a new immutable SpanData.
        Since:
        0.14
      • getContext

        public abstract SpanContext getContext()
        Returns the SpanContext associated with this Span.
        Returns:
        the SpanContext associated with this Span.
        Since:
        0.5
      • getParentSpanId

        @Nullable
        public abstract SpanId getParentSpanId()
        Returns the parent SpanId or null if the Span is a root Span.
        Returns:
        the parent SpanId or null if the Span is a root Span.
        Since:
        0.5
      • getHasRemoteParent

        @Nullable
        public abstract java.lang.Boolean getHasRemoteParent()
        Returns true if the parent is on a different process. null if this is a root span.
        Returns:
        true if the parent is on a different process. null if this is a root span.
        Since:
        0.5
      • getName

        public abstract java.lang.String getName()
        Returns the name of this Span.
        Returns:
        the name of this Span.
        Since:
        0.5
      • getKind

        @Nullable
        public abstract Span.Kind getKind()
        Returns the kind of this Span.
        Returns:
        the kind of this Span.
        Since:
        0.14
      • getStartTimestamp

        public abstract Timestamp getStartTimestamp()
        Returns the start Timestamp of this Span.
        Returns:
        the start Timestamp of this Span.
        Since:
        0.5
      • getAttributes

        public abstract SpanData.Attributes getAttributes()
        Returns the attributes recorded for this Span.
        Returns:
        the attributes recorded for this Span.
        Since:
        0.5
      • getAnnotations

        public abstract SpanData.TimedEvents<Annotation> getAnnotations()
        Returns the annotations recorded for this Span.
        Returns:
        the annotations recorded for this Span.
        Since:
        0.5
      • getMessageEvents

        public abstract SpanData.TimedEvents<MessageEvent> getMessageEvents()
        Returns message events recorded for this Span.
        Returns:
        message events recorded for this Span.
        Since:
        0.12
      • getLinks

        public abstract SpanData.Links getLinks()
        Returns links recorded for this Span.
        Returns:
        links recorded for this Span.
        Since:
        0.5
      • getChildSpanCount

        @Nullable
        public abstract java.lang.Integer getChildSpanCount()
        Returns the number of child spans that were generated while the Span was running. If not null allows service implementations to detect missing child spans.

        This information is not always available.

        Returns:
        the number of child spans that were generated while the Span was running.
        Since:
        0.5
      • getStatus

        @Nullable
        public abstract Status getStatus()
        Returns the Status or null if Span is still active.
        Returns:
        the Status or null if Span is still active.
        Since:
        0.5
      • getEndTimestamp

        @Nullable
        public abstract Timestamp getEndTimestamp()
        Returns the end Timestamp or null if the Span is still active.
        Returns:
        the end Timestamp or null if the Span is still active.
        Since:
        0.5