@ThreadSafe public final class OpenTelemetry extends Object
Tracer, Meter
and CorrelationContextManager.
The telemetry objects are lazy-loaded singletons resolved via ServiceLoader mechanism.
| Modifier and Type | Method and Description |
|---|---|
static CorrelationContextManager |
getCorrelationContextManager()
Returns a singleton
CorrelationContextManager. |
static MeterProvider |
getMeterProvider()
Returns a singleton
MeterProvider. |
static io.opentelemetry.context.propagation.ContextPropagators |
getPropagators()
Returns a
ContextPropagators object, which can be used to access the set of registered
propagators for each supported format. |
static TracerProvider |
getTracerProvider()
Returns a singleton
TracerProvider. |
static void |
setPropagators(io.opentelemetry.context.propagation.ContextPropagators propagators)
Sets the
ContextPropagators object, which can be used to access the set of registered
propagators for each supported format. |
public static TracerProvider getTracerProvider()
TracerProvider.DefaultTracerProvider.getInstance().IllegalStateException - if a specified TracerProvider (via system properties) could not
be found.public static MeterProvider getMeterProvider()
MeterProvider.DefaultMeterProvider.getInstance().IllegalStateException - if a specified MeterProvider (via system properties) could not be
found.public static CorrelationContextManager getCorrelationContextManager()
CorrelationContextManager.DefaultCorrelationContextManager.getInstance().IllegalStateException - if a specified manager (via system properties) could not be
found.public static io.opentelemetry.context.propagation.ContextPropagators getPropagators()
ContextPropagators object, which can be used to access the set of registered
propagators for each supported format.ContextPropagators object
with HttpTraceContext registered.IllegalStateException - if a specified manager (via system properties) could not be
found.public static void setPropagators(io.opentelemetry.context.propagation.ContextPropagators propagators)
ContextPropagators object, which can be used to access the set of registered
propagators for each supported format.propagators - the ContextPropagators object to be registered.IllegalStateException - if a specified manager (via system properties) could not be
found.NullPointerException - if propagators is null.