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:
  • Method Details

    • noop

      static OpenTelemetry noop()
      Returns a completely no-op OpenTelemetry.
    • 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.
    • getTracerProvider

      TracerProvider getTracerProvider()
      Returns the TracerProvider for this OpenTelemetry.
    • getTracer

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

      default Tracer getTracer(String instrumentationScopeName, String instrumentationScopeVersion)
      Gets or creates a named and versioned tracer instance from the TracerProvider in this OpenTelemetry.
      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

      default TracerBuilder tracerBuilder(String instrumentationScopeName)
      Creates a TracerBuilder for a named Tracer instance.
      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.
      Since:
      1.4.0
    • getMeterProvider

      default MeterProvider getMeterProvider()
      Returns the MeterProvider for this OpenTelemetry.
      Since:
      1.10.0
    • getMeter

      default Meter getMeter(String instrumentationScopeName)
      Gets or creates a named meter instance from the MeterProvider for this OpenTelemetry.
      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 Meter instance.
      Since:
      1.10.0
    • meterBuilder

      default MeterBuilder meterBuilder(String instrumentationScopeName)
      Creates a MeterBuilder for a named Tracer instance.
      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 MeterBuilder instance.
      Since:
      1.10.0
    • getPropagators

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