Package io.opentelemetry.api
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:
-
TracerProviderContextPropagators
-
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.context.propagation.ContextPropagatorsReturns theContextPropagatorsfor thisOpenTelemetry.default TracerGets or creates a named tracer instance from theTracerProviderfor thisOpenTelemetry.default TracerGets or creates a named and versioned tracer instance from theTracerProviderin thisOpenTelemetry.Returns theTracerProviderfor thisOpenTelemetry.static OpenTelemetrynoop()Returns a completely no-opOpenTelemetry.static OpenTelemetrypropagating(io.opentelemetry.context.propagation.ContextPropagators propagators) Returns anOpenTelemetrywhich will do remote propagation ofContextusing the providedContextPropagatorsand is no-op otherwise.default TracerBuildertracerBuilder(String instrumentationName) Creates aTracerBuilderfor a namedTracerinstance.
-
Method Details
-
noop
Returns a completely no-opOpenTelemetry. -
propagating
static OpenTelemetry propagating(io.opentelemetry.context.propagation.ContextPropagators propagators) Returns anOpenTelemetrywhich will do remote propagation ofContextusing the providedContextPropagatorsand is no-op otherwise. -
getTracerProvider
TracerProvider getTracerProvider()Returns theTracerProviderfor thisOpenTelemetry. -
getTracer
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
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.
-
tracerBuilder
Creates aTracerBuilderfor a namedTracerinstance.- Parameters:
instrumentationName- The name of the instrumentation library, not the name of the instrument*ed* library.- Returns:
- a TracerBuilder instance.
- Since:
- 1.4.0
-
getPropagators
io.opentelemetry.context.propagation.ContextPropagators getPropagators()Returns theContextPropagatorsfor thisOpenTelemetry.
-