Interface TracerProvider

All Known Implementing Classes:
JaegerTracerProvider, OpenTelemetryTracerProvider, OpenTracingTracerProvider

public interface TracerProvider
Java service to integrate various distributed tracers. The first tracer configured will be used.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether there is a tracer available by this provider.
    Create a new builder for this tracer.
    Provide current span.
    Global tracer that is registered, or a NoOp tracer if none is registered.
    void
    global(Tracer tracer)
    Register a global tracer instance.
  • Method Details

    • createBuilder

      TracerBuilder<?> createBuilder()
      Create a new builder for this tracer.
      Returns:
      a tracer builder
    • global

      Tracer global()
      Global tracer that is registered, or a NoOp tracer if none is registered.
      Returns:
      current global tracer
    • global

      void global(Tracer tracer)
      Register a global tracer instance. This method should not fail except for the case that tracer is null - if the tracer cannot be registered, silently ignore it.
      Parameters:
      tracer - tracer to register as global
      Throws:
      NullPointerException - in case the tracer is null
    • currentSpan

      Optional<Span> currentSpan()
      Provide current span.
      Returns:
      current span, or empty optional if current span cannot be found
    • available

      boolean available()
      Whether there is a tracer available by this provider. This allows co-existence of multiple tracing providers within the same VM.
      Returns:
      whether this tracer provider has a tracer available