Class DefaultInMemorySpanContext

java.lang.Object
io.servicetalk.opentracing.inmemory.DefaultInMemorySpanContext
All Implemented Interfaces:
io.opentracing.SpanContext, InMemorySpanContext

public final class DefaultInMemorySpanContext extends Object implements InMemorySpanContext
SpanContext object used by the DefaultInMemoryTracer.
  • Constructor Details

    • DefaultInMemorySpanContext

      public DefaultInMemorySpanContext(String traceId, String spanId, @Nullable String parentSpanId, @Nullable Boolean sampled)
      Constructs an instance.
      Parameters:
      traceId - trace ID
      spanId - span ID
      parentSpanId - parent span ID, optional
      sampled - whether the trace is sampled
  • Method Details

    • isSampled

      public Boolean isSampled()
      Description copied from interface: InMemorySpanContext
      Returns whether the span should be sampled or null if the sampling was not decided.
      Specified by:
      isSampled in interface InMemorySpanContext
      Returns:
      whether the span should be sampled
    • baggageItems

      public Iterable<Map.Entry<String,String>> baggageItems()
      Specified by:
      baggageItems in interface io.opentracing.SpanContext
    • toSpanId

      public String toSpanId()
      Specified by:
      toSpanId in interface io.opentracing.SpanContext
    • toTraceId

      public String toTraceId()
      Specified by:
      toTraceId in interface io.opentracing.SpanContext
    • parentSpanId

      public String parentSpanId()
      Description copied from interface: InMemorySpanContext
      Returns the parent span ID in hex, or null if the parent span ID is not present.
      Specified by:
      parentSpanId in interface InMemorySpanContext
      Returns:
      parent span ID in hex
    • toString

      public String toString()
      Overrides:
      toString in class Object