Class SpanImpl

  • All Implemented Interfaces:
    Span

    public class SpanImpl
    extends Object
    implements Span
    Implementation of a Span
    • Constructor Detail

      • SpanImpl

        public SpanImpl​(SpiSpecificSpan spiSpecificSpan,
                        SpanType spanType,
                        Set<Scope> includedScopes)
        Constructor
        Parameters:
        spiSpecificSpan - Spi specific span.
        spanType - Type of a span.
        includedScopes - Set of included scopes.
    • Method Detail

      • addTag

        public Span addTag​(String tagName,
                           Supplier<String> tagValSupplier)
        Adds tag to span with String value.
        Specified by:
        addTag in interface Span
        Parameters:
        tagName - Tag name.
        tagValSupplier - Tag value supplier. Supplier is used instead of strict tag value cause of it's lazy nature. So that it's possible not to generate String tag value in case of NoopSpan.
      • addLog

        public Span addLog​(Supplier<String> logDescSupplier)
        Logs work to span.
        Specified by:
        addLog in interface Span
        Parameters:
        logDescSupplier - Log description supplier. Supplier is used instead of strict log description cause of it's lazy nature. So that it's possible not to generate String log description in case of NoopSpan.
      • setStatus

        public Span setStatus​(SpanStatus spanStatus)
        Explicitly set status for span.
        Specified by:
        setStatus in interface Span
        Parameters:
        spanStatus - Status.
      • end

        public Span end()
        Ends span. This action sets default status if not set and mark the span as ready to be exported.
        Specified by:
        end in interface Span
      • isEnded

        public boolean isEnded()
        Specified by:
        isEnded in interface Span
        Returns:
        true if span has already ended.
      • type

        public SpanType type()
        Specified by:
        type in interface Span
        Returns:
        Type of given span.
      • includedScopes

        public Set<Scope> includedScopes()
        Specified by:
        includedScopes in interface Span
        Returns:
        Set of included scopes.
      • spiSpecificSpan

        public SpiSpecificSpan spiSpecificSpan()
        Returns:
        Spi specific span delegate.