Class OpenTelemetrySdk.ObfuscatedTracerProvider

java.lang.Object
io.opentelemetry.sdk.OpenTelemetrySdk.ObfuscatedTracerProvider
All Implemented Interfaces:
TracerProvider
Enclosing class:
OpenTelemetrySdk

@ThreadSafe static class OpenTelemetrySdk.ObfuscatedTracerProvider extends Object implements TracerProvider
This class allows the SDK to unobfuscate an obfuscated static global provider.

Static global providers are obfuscated when they are returned from the API to prevent users from casting them to their SDK specific implementation. For example, we do not want users to use patterns like (SdkTracerProvider) openTelemetry.getTracerProvider().

  • Field Details

  • Constructor Details

  • Method Details

    • get

      public Tracer get(String instrumentationScopeName)
      Description copied from interface: TracerProvider
      Gets or creates a named tracer instance.
      Specified by:
      get in interface TracerProvider
      Parameters:
      instrumentationScopeName - A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.
      Returns:
      a tracer instance.
    • get

      public Tracer get(String instrumentationScopeName, String instrumentationScopeVersion)
      Description copied from interface: TracerProvider
      Gets or creates a named and versioned tracer instance.
      Specified by:
      get in interface TracerProvider
      Parameters:
      instrumentationScopeName - A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.
      instrumentationScopeVersion - The version of the instrumentation scope (e.g., "1.0.0").
      Returns:
      a tracer instance.
    • tracerBuilder

      public TracerBuilder tracerBuilder(String instrumentationScopeName)
      Description copied from interface: TracerProvider
      Creates a TracerBuilder for a named Tracer instance.
      Specified by:
      tracerBuilder in interface TracerProvider
      Parameters:
      instrumentationScopeName - A name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name. Must not be null.
      Returns:
      a TracerBuilder instance.
    • unobfuscate

      public SdkTracerProvider unobfuscate()