Class DefaultInMemoryTracer.Builder

java.lang.Object
io.servicetalk.opentracing.inmemory.DefaultInMemoryTracer.Builder
Enclosing class:
DefaultInMemoryTracer

public static final class DefaultInMemoryTracer.Builder extends Object
Builders for DefaultInMemoryTracer.
  • Constructor Details

  • Method Details

    • withSampler

      public DefaultInMemoryTracer.Builder withSampler(Predicate<String> sampler)
      Sets the sampler.
      Parameters:
      sampler - policy which takes a traceId and returns whether the given trace should be sampled
      Returns:
      this
    • withSampler

      Sets the sampler.
      Parameters:
      sampler - policy which takes a traceId and the sampling flag specified in carrier (optional, could be null), and returns whether the given trace should be sampled.
      Returns:
      this
    • addListener

      Add a trace event listener.
      Parameters:
      listener - listener to add
      Returns:
      this
    • withMaxTagSize

      public DefaultInMemoryTracer.Builder withMaxTagSize(int maxTagSize)
      Sets the maximum number of tags.
      Parameters:
      maxTagSize - maximum number of tags
      Returns:
      this
    • persistLogs

      public DefaultInMemoryTracer.Builder persistLogs(boolean persistLogs)
      Sets whether logs are persisted in the span object. This is necessary when using using listeners which sends the span to a backend on span finish.
      Parameters:
      persistLogs - whether to persist logs in the span object. Defaults to false.
      Returns:
      this
    • use128BitTraceId

      public DefaultInMemoryTracer.Builder use128BitTraceId(boolean use128BitTraceId)
      Sets whether to use 128-bit trace IDs.
      Parameters:
      use128BitTraceId - whether to use 128-bit trace IDs.
      Returns:
      this
    • build

      public DefaultInMemoryTracer build()
      Returns:
      tracer