public class OpenTelemetryTracer extends Object implements Tracer
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.
AZ_TRACING_NAMESPACE_KEY, DIAGNOSTIC_ID_KEY, DISABLE_TRACING_KEY, ENTITY_PATH_KEY, HOST_NAME_KEY, MESSAGE_ENQUEUED_TIME, PARENT_SPAN_KEY, SCOPE_KEY, SPAN_BUILDER_KEY, SPAN_CONTEXT_KEY, USER_SPAN_NAME_KEY
Constructor and Description |
---|
OpenTelemetryTracer() |
Modifier and Type | Method and Description |
---|---|
void |
addEvent(String eventName,
Map<String,Object> traceEventAttributes,
OffsetDateTime timestamp) |
void |
addLink(Context context) |
void |
end(int responseCode,
Throwable throwable,
Context context) |
void |
end(String statusMessage,
Throwable throwable,
Context context) |
Context |
extractContext(String diagnosticId,
Context context) |
Context |
getSharedSpanBuilder(String spanName,
Context context) |
void |
setAttribute(String key,
String value,
Context context) |
Context |
setSpanName(String spanName,
Context context) |
Context |
start(String spanName,
Context context) |
Context |
start(String spanName,
Context context,
ProcessKind processKind) |
public Context start(String spanName, Context context, ProcessKind processKind)
public void setAttribute(String key, String value, Context context)
setAttribute
in interface Tracer
public Context setSpanName(String spanName, Context context)
setSpanName
in interface Tracer
public Context extractContext(String diagnosticId, Context context)
extractContext
in interface Tracer
public Context getSharedSpanBuilder(String spanName, Context context)
getSharedSpanBuilder
in interface Tracer
Copyright © 2021 Microsoft Corporation. All rights reserved.