Interface TraceMetadata


  • public interface TraceMetadata
    Used to provide information about the currently executing trace.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getSpanId()
      Returns the span identifier associated with the current executing span.
      java.lang.String getTraceId()
      Returns the currently executing trace identifier.
      boolean isSampled()
      Returns whether or not the current transaction is sampled from a distributed tracing perspective.
    • Method Detail

      • getTraceId

        java.lang.String getTraceId()
        Returns the currently executing trace identifier. An empty String will be returned if the transaction does not support this functionality, distributed tracing is disabled or if the trace identifier is not known at the time of the method call.
        Returns:
        the trace identifier associated with the current context.
        Since:
        5.6.0
      • getSpanId

        java.lang.String getSpanId()
        Returns the span identifier associated with the current executing span. An empty String will be returned if the span does not support this functionality, distributed tracing is disabled or if the span identifier is not known at the time of the method call.
        Returns:
        the span identifier associated with the current executing span.
        Since:
        5.6.0
      • isSampled

        boolean isSampled()
        Returns whether or not the current transaction is sampled from a distributed tracing perspective. If distributed tracing is disabled this method will always return false.
        Returns:
        true if distributed tracing is enabled and this transaction is sampled, false otherwise
        Since:
        5.6.0