Class OpenTelemetryTracer
java.lang.Object
com.azure.core.tracing.opentelemetry.OpenTelemetryTracer
- All Implemented Interfaces:
Tracer
Basic tracing implementation class for use with REST and AMQP Service Clients to create
Span and in-process
context propagation. Singleton OpenTelemetry tracer capable of starting and exporting spans.
This helper class supports W3C distributed tracing protocol and injects SpanContext into the outgoing HTTP and AMQP requests.
-
Field Summary
Fields inherited from interface com.azure.core.util.tracing.Tracer
DIAGNOSTIC_ID_KEY, DISABLE_TRACING_KEY, ENTITY_PATH_KEY, HOST_NAME_KEY, MESSAGE_ENQUEUED_TIME, PARENT_SPAN_KEY, PARENT_TRACE_CONTEXT_KEY, SCOPE_KEY, SPAN_BUILDER_KEY, SPAN_CONTEXT_KEY, USER_SPAN_NAME_KEY -
Constructor Summary
ConstructorsConstructorDescriptionCreates newOpenTelemetryTracerusing default global tracer -GlobalOpenTelemetry.getTracer(String) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEvent(String eventName, Map<String, Object> traceEventAttributes, OffsetDateTime timestamp, Context context) voidextractContext(Function<String, String> headerGetter) voidinjectContext(BiConsumer<String, String> headerSetter, Context context) booleanbooleanisRecording(Context context) makeSpanCurrent(Context context) voidsetAttribute(String key, long value, Context context) voidsetAttribute(String key, Object value, Context context) voidsetAttribute(String key, String value, Context context) start(String spanName, StartSpanOptions options, Context context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.core.util.tracing.Tracer
addEvent, addLink, end, extractContext, getSharedSpanBuilder, setSpanName, start
-
Constructor Details
-
OpenTelemetryTracer
public OpenTelemetryTracer()Creates newOpenTelemetryTracerusing default global tracer -GlobalOpenTelemetry.getTracer(String)
-
-
Method Details
-
start
-
start
-
injectContext
- Specified by:
injectContextin interfaceTracer
-
setAttribute
- Specified by:
setAttributein interfaceTracer
-
setAttribute
- Specified by:
setAttributein interfaceTracer
-
setAttribute
- Specified by:
setAttributein interfaceTracer
-
end
-
extractContext
- Specified by:
extractContextin interfaceTracer
-
isRecording
- Specified by:
isRecordingin interfaceTracer
-
makeSpanCurrent
- Specified by:
makeSpanCurrentin interfaceTracer
-
addEvent
-
isEnabled
public boolean isEnabled()
-