Interface OpenTelemetry


  • public interface OpenTelemetry
    The entrypoint to telemetry functionality for tracing, metrics and baggage.

    If using the OpenTelemetry SDK, you may want to instantiate the OpenTelemetry to provide configuration, for example of Resource or Sampler. See OpenTelemetrySdk and OpenTelemetrySdk.builder for information on how to construct the SDK OpenTelemetry.

    See Also:
    TracerProvider, ContextPropagators
    • Method Detail

      • propagating

        static OpenTelemetry propagating​(io.opentelemetry.context.propagation.ContextPropagators propagators)
        Returns an OpenTelemetry which will do remote propagation of Context using the provided ContextPropagators and is no-op otherwise.
      • getTracer

        default Tracer getTracer​(String instrumentationName)
        Gets or creates a named tracer instance from the TracerProvider for this OpenTelemetry.
        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.
        Returns:
        a tracer instance.
      • getTracer

        default Tracer getTracer​(String instrumentationName,
                                 String instrumentationVersion)
        Gets or creates a named and versioned tracer instance from the TracerProvider in this OpenTelemetry.
        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.
        instrumentationVersion - The version of the instrumentation library (e.g., "1.0.0").
        Returns:
        a tracer instance.
      • getPropagators

        io.opentelemetry.context.propagation.ContextPropagators getPropagators()
        Returns the ContextPropagators for this OpenTelemetry.