Class OpenTelemetrySdk.ObfuscatedTracerProvider

  • All Implemented Interfaces:
    TracerProvider
    Enclosing class:
    OpenTelemetrySdk

    @ThreadSafe
    static class OpenTelemetrySdk.ObfuscatedTracerProvider
    extends java.lang.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().

    • Constructor Detail

    • Method Detail

      • get

        public Tracer get​(java.lang.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​(java.lang.String instrumentationScopeName,
                          java.lang.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​(java.lang.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.