Package io.opentelemetry.api
Interface OpenTelemetry
-
- All Known Implementing Classes:
DefaultOpenTelemetry
public interface OpenTelemetryThe entrypoint to telemetry functionality for tracing, metrics and baggage.If using the OpenTelemetry SDK, you may want to instantiate the
OpenTelemetryto provide configuration, for example ofResourceorSampler. SeeOpenTelemetrySdkandOpenTelemetrySdk.builderfor information on how to construct the SDKOpenTelemetry.- See Also:
TracerProvider,ContextPropagators
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.opentelemetry.context.propagation.ContextPropagatorsgetPropagators()Returns theContextPropagatorsfor thisOpenTelemetry.default TracergetTracer(String instrumentationName)Gets or creates a named tracer instance from theTracerProviderfor thisOpenTelemetry.default TracergetTracer(String instrumentationName, String instrumentationVersion)Gets or creates a named and versioned tracer instance from theTracerProviderin thisOpenTelemetry.TracerProvidergetTracerProvider()Returns theTracerProviderfor thisOpenTelemetry.
-
-
-
Method Detail
-
getTracerProvider
TracerProvider getTracerProvider()
Returns theTracerProviderfor thisOpenTelemetry.
-
getTracer
default Tracer getTracer(String instrumentationName)
Gets or creates a named tracer instance from theTracerProviderfor thisOpenTelemetry.- 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 theTracerProviderin thisOpenTelemetry.- 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 theContextPropagatorsfor thisOpenTelemetry.
-
-