Interface TracerProvider


@ThreadSafe public interface TracerProvider
A registry for creating named Tracers. The name Provider is for consistency with * other languages and it is NOT loaded using reflection.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String instrumentationName)
    Gets or creates a named tracer instance.
    get(String instrumentationName, String instrumentationVersion)
    Gets or creates a named and versioned tracer instance.
    Returns a no-op TracerProvider which only creates no-op Spans which do not record nor are emitted.
    tracerBuilder(String instrumentationName)
    Creates a TracerBuilder for a named Tracer instance.
  • Method Details

    • noop

      static TracerProvider noop()
      Returns a no-op TracerProvider which only creates no-op Spans which do not record nor are emitted.
    • get

      Tracer get(String instrumentationName)
      Gets or creates a named tracer instance.
      Parameters:
      instrumentationName - The name of the instrumentation library, not the name of the instrument*ed* library (e.g., "io.opentelemetry.contrib.mongodb"). Must not be null. If the instrumented library is providing its own instrumentation, this should match the library name.
      Returns:
      a tracer instance.
    • get

      Tracer get(String instrumentationName, String instrumentationVersion)
      Gets or creates a named and versioned tracer instance.
      Parameters:
      instrumentationName - The name of the instrumentation library, not the name of the instrument*ed* library (e.g., "io.opentelemetry.contrib.mongodb"). Must not be null. If the instrumented library is providing its own instrumentation, this should match the library name.
      instrumentationVersion - The version of the instrumentation library (e.g., "1.0.0").
      Returns:
      a tracer instance.
    • tracerBuilder

      default TracerBuilder tracerBuilder(String instrumentationName)
      Creates a TracerBuilder for a named Tracer instance.
      Parameters:
      instrumentationName - The name of the instrumentation library, not the name of the instrument*ed* library.
      Returns:
      a TracerBuilder instance.
      Since:
      1.4.0