Class OpenTelemetryTracerProvider
java.lang.Object
io.helidon.tracing.providers.opentelemetry.OpenTelemetryTracerProvider
- All Implemented Interfaces:
TracerProvider
Service loader provider implementation for
TracerProvider
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns aSpan
representing the currently-active OpenTelemetry span with any current baggage set on the returned span.boolean
Whether there is a tracer available by this provider.Create a new builder for this tracer.Provide current span.global()
Global tracer that is registered, or a NoOp tracer if none is registered.void
Register a global tracer instance.static Tracer
Registered global tracer, or tracer from global open telemetry.static void
globalTracer
(Tracer tracer) Register global tracer.
-
Constructor Details
-
OpenTelemetryTracerProvider
Deprecated.Creates a new provider; reserved for service loading.
-
-
Method Details
-
globalTracer
Register global tracer.- Parameters:
tracer
- global tracer
-
globalTracer
Registered global tracer, or tracer from global open telemetry.- Returns:
- tracer
-
activeSpan
Returns aSpan
representing the currently-active OpenTelemetry span with any current baggage set on the returned span.- Returns:
- optional of the current span
-
createBuilder
Description copied from interface:TracerProvider
Create a new builder for this tracer.- Specified by:
createBuilder
in interfaceTracerProvider
- Returns:
- a tracer builder
-
global
Description copied from interface:TracerProvider
Global tracer that is registered, or a NoOp tracer if none is registered.- Specified by:
global
in interfaceTracerProvider
- Returns:
- current global tracer
-
global
Description copied from interface:TracerProvider
Register a global tracer instance. This method should not fail except for the case that tracer is null - if the tracer cannot be registered, silently ignore it.- Specified by:
global
in interfaceTracerProvider
- Parameters:
tracer
- tracer to register as global
-
currentSpan
Description copied from interface:TracerProvider
Provide current span.- Specified by:
currentSpan
in interfaceTracerProvider
- Returns:
- current span, or empty optional if current span cannot be found
-
available
public boolean available()Description copied from interface:TracerProvider
Whether there is a tracer available by this provider. This allows co-existence of multiple tracing providers within the same VM.- Specified by:
available
in interfaceTracerProvider
- Returns:
- whether this tracer provider has a tracer available
-