azure-docs-sdk-java/docs-ref-autogen/com.azure.core.util.tracing...

544 строки
47 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.util.tracing.Tracer"
fullName: "com.azure.core.util.tracing.Tracer"
name: "Tracer"
nameWithType: "Tracer"
summary: "Contract that all tracers must implement to be pluggable into the SDK."
syntax: "public interface **Tracer**"
fields:
- uid: "com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY"
fullName: "com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY"
name: "AZ_TRACING_NAMESPACE_KEY"
nameWithType: "Tracer.AZ_TRACING_NAMESPACE_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the Azure resource provider namespace."
deprecatedTag: "Pass Azure Resource Provider Namespace to Tracer factory method <xref uid=\"com.azure.core.util.tracing.TracerProvider.createTracer(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.TracingOptions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TracerProvider#createTracer(String, String, String, TracingOptions)\"></xref>"
modifiers:
- "static"
- "final"
field:
value: "az.namespace"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String AZ_TRACING_NAMESPACE_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the Azure resource provider namespace."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY"
fullName: "com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY"
name: "DIAGNOSTIC_ID_KEY"
nameWithType: "Tracer.DIAGNOSTIC_ID_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a \"Diagnostic Id\" for the service call."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.extractContext(java.util.function.Function<java.lang.String,java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#extractContext(Function)\"></xref> and <xref uid=\"com.azure.core.util.tracing.Tracer.injectContext(java.util.function.BiConsumer<java.lang.String,java.lang.String>,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#injectContext(BiConsumer, Context)\"></xref> for context propagation."
modifiers:
- "static"
- "final"
field:
value: "Diagnostic-Id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String DIAGNOSTIC_ID_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a \"Diagnostic Id\" for the service call."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.DISABLE_TRACING_KEY"
fullName: "com.azure.core.util.tracing.Tracer.DISABLE_TRACING_KEY"
name: "DISABLE_TRACING_KEY"
nameWithType: "Tracer.DISABLE_TRACING_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which disables tracing for the request associated with the current context."
modifiers:
- "static"
- "final"
field:
value: "disable-tracing"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String DISABLE_TRACING_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which disables tracing for the request associated with the current context."
- uid: "com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY"
fullName: "com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY"
name: "ENTITY_PATH_KEY"
nameWithType: "Tracer.ENTITY_PATH_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains an entity path."
modifiers:
- "static"
- "final"
field:
value: "entity-path"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String ENTITY_PATH_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains an entity path."
- uid: "com.azure.core.util.tracing.Tracer.HOST_NAME_KEY"
fullName: "com.azure.core.util.tracing.Tracer.HOST_NAME_KEY"
name: "HOST_NAME_KEY"
nameWithType: "Tracer.HOST_NAME_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the hostname."
modifiers:
- "static"
- "final"
field:
value: "hostname"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String HOST_NAME_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the hostname."
- uid: "com.azure.core.util.tracing.Tracer.MESSAGE_ENQUEUED_TIME"
fullName: "com.azure.core.util.tracing.Tracer.MESSAGE_ENQUEUED_TIME"
name: "MESSAGE_ENQUEUED_TIME"
nameWithType: "Tracer.MESSAGE_ENQUEUED_TIME"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the time of the last enqueued message in the partition's stream."
deprecatedTag: "Use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> and pass enqueued time as an attribute on link."
modifiers:
- "static"
- "final"
field:
value: "x-opt-enqueued-time"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String MESSAGE_ENQUEUED_TIME"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the time of the last enqueued message in the partition's stream."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.PARENT_SPAN_KEY"
fullName: "com.azure.core.util.tracing.Tracer.PARENT_SPAN_KEY"
name: "PARENT_SPAN_KEY"
nameWithType: "Tracer.PARENT_SPAN_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains parent span data."
deprecatedTag: "Deprecated in favor of PARENT\\_TRACE\\_CONTEXT\\_KEY, use it to propagate full io.<wbr>opentelemetry.<wbr>Context"
modifiers:
- "static"
- "final"
field:
value: "parent-span"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String PARENT_SPAN_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains parent span data. This span will be used as the parent span for all spans the SDK creates.\n\nIf no span data is listed when the span is created it will default to using this span key as the parent span."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.PARENT_TRACE_CONTEXT_KEY"
fullName: "com.azure.core.util.tracing.Tracer.PARENT_TRACE_CONTEXT_KEY"
name: "PARENT_TRACE_CONTEXT_KEY"
nameWithType: "Tracer.PARENT_TRACE_CONTEXT_KEY"
summary: "<xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> key to store trace context."
modifiers:
- "static"
- "final"
field:
value: "trace-context"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String PARENT_TRACE_CONTEXT_KEY"
desc: "<xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> key to store trace context. This context will be used as a parent context for new spans and propagated in outgoing HTTP calls."
- uid: "com.azure.core.util.tracing.Tracer.SCOPE_KEY"
fullName: "com.azure.core.util.tracing.Tracer.SCOPE_KEY"
name: "SCOPE_KEY"
nameWithType: "Tracer.SCOPE_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> the scope of code where the given Span is in the current Context."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.makeSpanCurrent(com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#makeSpanCurrent(Context)\"></xref> instead."
modifiers:
- "static"
- "final"
field:
value: "scope"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String SCOPE_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> the scope of code where the given Span is in the current Context."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.SPAN_BUILDER_KEY"
fullName: "com.azure.core.util.tracing.Tracer.SPAN_BUILDER_KEY"
name: "SPAN_BUILDER_KEY"
nameWithType: "Tracer.SPAN_BUILDER_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the shared span builder that is in the current Context."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> instead"
modifiers:
- "static"
- "final"
field:
value: "builder"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String SPAN_BUILDER_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the shared span builder that is in the current Context."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY"
fullName: "com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY"
name: "SPAN_CONTEXT_KEY"
nameWithType: "Tracer.SPAN_CONTEXT_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a message span context."
modifiers:
- "static"
- "final"
field:
value: "span-context"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String SPAN_CONTEXT_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a message span context."
- uid: "com.azure.core.util.tracing.Tracer.USER_SPAN_NAME_KEY"
fullName: "com.azure.core.util.tracing.Tracer.USER_SPAN_NAME_KEY"
name: "USER_SPAN_NAME_KEY"
nameWithType: "Tracer.USER_SPAN_NAME_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the name for the user spans that are created."
deprecatedTag: "please pass span name to Tracer.<wbr>start methods."
modifiers:
- "static"
- "final"
field:
value: "user-span-name"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String USER_SPAN_NAME_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the name for the user spans that are created.\n\nIf no span name is listed when the span is created it will default to using the calling method's name."
hasDeprecatedTag: true
methods:
- uid: "com.azure.core.util.tracing.Tracer.addEvent(java.lang.String,java.util.Map<java.lang.String,java.lang.Object>,java.time.OffsetDateTime)"
fullName: "com.azure.core.util.tracing.Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
name: "addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
nameWithType: "Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
summary: "Adds an event to the current span with the provided `timestamp` and `attributes`."
deprecatedTag: "Use <xref uid=\"com.azure.core.util.tracing.Tracer.addEvent(java.lang.String,java.util.Map<java.lang.String,java.lang.Object>,java.time.OffsetDateTime,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#addEvent(String, Map, OffsetDateTime, Context)\"></xref>"
modifiers:
- "default"
parameters:
- description: "the name of the event."
name: "name"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the additional attributes to be set for the event."
name: "attributes"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>&gt;"
- description: "The instant, in UTC, at which the event will be associated to the span."
name: "timestamp"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html\">OffsetDateTime</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default void addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
desc: "Adds an event to the current span with the provided `timestamp` and `attributes`.\n\nThis API does not provide any normalization if provided timestamps are out of range of the current span timeline\n\nSupported attribute values include String, double, boolean, long, String \\[\\], double \\[\\], long \\[\\]. Any other Object value type and null values will be silently ignored."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.addEvent(java.lang.String,java.util.Map<java.lang.String,java.lang.Object>,java.time.OffsetDateTime,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
name: "addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
nameWithType: "Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
summary: "Adds an event to the span present in the `Context` with the provided `timestamp` and `attributes`."
modifiers:
- "default"
parameters:
- description: "the name of the event."
name: "name"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the additional attributes to be set for the event."
name: "attributes"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>&gt;"
- description: "The instant, in UTC, at which the event will be associated to the span."
name: "timestamp"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html\">OffsetDateTime</a>"
- description: "the call metadata containing information of the span to which the event should be associated with."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
desc: "Adds an event to the span present in the `Context` with the provided `timestamp` and `attributes`.\n\nThis API does not provide any normalization if provided timestamps are out of range of the current span timeline\n\nSupported attribute values include String, double, boolean, long, String \\[\\], double \\[\\], long \\[\\]. Any other Object value type and null values will be silently ignored.\n\n```java\nContext span = tracer.start(\"Cosmos.getItem\", Context.NONE);\n tracer.addEvent(\"trying another endpoint\", Collections.singletonMap(\"endpoint\", \"westus3\"), OffsetDateTime.now(), span);\n```"
- uid: "com.azure.core.util.tracing.Tracer.addLink(com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.addLink(Context context)"
name: "addLink(Context context)"
nameWithType: "Tracer.addLink(Context context)"
summary: "Provides a way to link multiple tracing spans."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> )\\}"
modifiers:
- "default"
parameters:
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default void addLink(Context context)"
desc: "Provides a way to link multiple tracing spans. Used in batching operations to relate multiple requests under a single batch.\n\n**Code samples**\n\nLink multiple spans using their span context information"
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.end(int,java.lang.Throwable,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.end(int responseCode, Throwable error, Context context)"
name: "end(int responseCode, Throwable error, Context context)"
nameWithType: "Tracer.end(int responseCode, Throwable error, Context context)"
summary: "Completes the current tracing span."
deprecatedTag: "set specific attribute e.<wbr>g. http\\_status\\_code explicitly and use <xref uid=\"com.azure.core.util.tracing.Tracer.end(java.lang.String,java.lang.Throwable,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#end(String, Throwable, Context)\"></xref>."
modifiers:
- "default"
parameters:
- description: "Response status code if the span is in an HTTP call context."
name: "responseCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "<xref uid=\"java.lang.Throwable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Throwable\"></xref> that happened during the span or <code>null</code> if no exception occurred."
name: "error"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default void end(int responseCode, Throwable error, Context context)"
desc: "Completes the current tracing span.\n\n**Code samples**\n\nCompletes the tracing span present in the context, with the corresponding OpenTelemetry status for the given response status code"
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.end(java.lang.String,java.lang.Throwable,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.end(String errorMessage, Throwable throwable, Context context)"
name: "end(String errorMessage, Throwable throwable, Context context)"
nameWithType: "Tracer.end(String errorMessage, Throwable throwable, Context context)"
summary: "Completes span on the context."
modifiers:
- "abstract"
parameters:
- description: "The error message that occurred during the call, or <code>null</code> if no error.\n occurred. Any other non-null string indicates an error with description provided in <code>errorMessage</code>."
name: "errorMessage"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "<xref uid=\"java.lang.Throwable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Throwable\"></xref> that happened during the span or <code>null</code> if no exception occurred."
name: "throwable"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract void end(String errorMessage, Throwable throwable, Context context)"
desc: "Completes span on the context.\n\n**Code samples**\n\nCompletes the tracing span with unset status\n\n```java\nContext messageSpan = tracer.start(\"ServiceBus.message\", new StartSpanOptions(SpanKind.PRODUCER), Context.NONE);\n tracer.end(null, null, messageSpan);\n```\n\nCompletes the tracing span with provided error message\n\n```java\nContext span = tracer.start(\"ServiceBus.send\", new StartSpanOptions(SpanKind.CLIENT), Context.NONE);\n tracer.end(\"amqp:not-found\", null, span);\n```\n\nCompletes the tracing span with provided exception\n\n```java\nContext sendSpan = tracer.start(\"ServiceBus.send\", new StartSpanOptions(SpanKind.CLIENT), Context.NONE);\n try (AutoCloseable scope = tracer.makeSpanCurrent(sendSpan)) {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, sendSpan);\n }\n```"
- uid: "com.azure.core.util.tracing.Tracer.extractContext(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.extractContext(String diagnosticId, Context context)"
name: "extractContext(String diagnosticId, Context context)"
nameWithType: "Tracer.extractContext(String diagnosticId, Context context)"
summary: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.extractContext(java.util.function.Function<java.lang.String,java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#extractContext(Function)\"></xref>"
modifiers:
- "default"
parameters:
- description: "Unique identifier for the trace information of the span."
name: "diagnosticId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context extractContext(String diagnosticId, Context context)"
desc: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream.\n\n**Code samples**\n\nExtracts the corresponding span context information from a valid diagnostic id"
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the span context."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.extractContext(java.util.function.Function<java.lang.String,java.lang.String>)"
fullName: "com.azure.core.util.tracing.Tracer.extractContext(Function<String,String> headerGetter)"
name: "extractContext(Function<String,String> headerGetter)"
nameWithType: "Tracer.extractContext(Function<String,String> headerGetter)"
summary: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream."
modifiers:
- "default"
parameters:
- description: "Unique identifier for the trace information of the span and todo."
name: "headerGetter"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html\">Function</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public default Context extractContext(Function<String,String> headerGetter)"
desc: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream.\n\n**Code samples**\n\nExtracts the corresponding span context information from a valid diagnostic id\n\n```java\nContext parentContext = tracer.extractContext(name -> {\n Object value = messageProperties.get(name);\n return value instanceof String ? (String) value : null;\n });\n\n StartSpanOptions remoteParentOptions = new StartSpanOptions(SpanKind.CONSUMER)\n .setRemoteParent(parentContext);\n\n Context spanWithRemoteParent = tracer.start(\"EventHubs.process\", remoteParentOptions, Context.NONE);\n\n try (AutoCloseable scope = tracer.makeSpanCurrent(spanWithRemoteParent)) {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, spanWithRemoteParent);\n }\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the span context."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.getSharedSpanBuilder(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.getSharedSpanBuilder(String spanName, Context context)"
name: "getSharedSpanBuilder(String spanName, Context context)"
nameWithType: "Tracer.getSharedSpanBuilder(String spanName, Context context)"
summary: "Returns a span builder with the provided name in <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> instead"
modifiers:
- "default"
parameters:
- description: "Name to give the span for the created builder."
name: "spanName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context getSharedSpanBuilder(String spanName, Context context)"
desc: "Returns a span builder with the provided name in <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>.\n\n**Code samples**\n\nReturns a builder with the provided span name."
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the span builder."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.injectContext(java.util.function.BiConsumer<java.lang.String,java.lang.String>,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.injectContext(BiConsumer<String,String> headerSetter, Context context)"
name: "injectContext(BiConsumer<String,String> headerSetter, Context context)"
nameWithType: "Tracer.injectContext(BiConsumer<String,String> headerSetter, Context context)"
summary: "Injects tracing context."
modifiers:
- "default"
parameters:
- description: "callback to set context with."
name: "headerSetter"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html\">BiConsumer</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "trace context instance"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void injectContext(BiConsumer<String,String> headerSetter, Context context)"
desc: "Injects tracing context.\n\n```java\nContext httpSpan = tracer.start(\"HTTP GET\", new StartSpanOptions(SpanKind.CLIENT), methodSpan);\n tracer.injectContext((headerName, headerValue) -> request.setHeader(headerName, headerValue), httpSpan);\n\n try (AutoCloseable scope = tracer.makeSpanCurrent(httpSpan)) {\n HttpResponse response = getResponse(request);\n httpResponseCode = response.getStatusCode();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(httpResponseCode, throwable, httpSpan);\n }\n```"
- uid: "com.azure.core.util.tracing.Tracer.isEnabled()"
fullName: "com.azure.core.util.tracing.Tracer.isEnabled()"
name: "isEnabled()"
nameWithType: "Tracer.isEnabled()"
summary: "Checks if tracer is enabled."
modifiers:
- "default"
syntax: "public default boolean isEnabled()"
desc: "Checks if tracer is enabled.\n\n```java\nif (!tracer.isEnabled()) {\n doWork();\n } else {\n Context span = tracer.start(\"span\", Context.NONE);\n try {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, span);\n }\n }\n```"
returns:
description: "true if tracer is enabled, false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.isRecording(com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.isRecording(Context span)"
name: "isRecording(Context span)"
nameWithType: "Tracer.isRecording(Context span)"
summary: "Checks if span is sampled in."
modifiers:
- "default"
parameters:
- description: "Span to check."
name: "span"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default boolean isRecording(Context span)"
desc: "Checks if span is sampled in."
returns:
description: "true if span is recording, false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.makeSpanCurrent(com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.makeSpanCurrent(Context context)"
name: "makeSpanCurrent(Context context)"
nameWithType: "Tracer.makeSpanCurrent(Context context)"
summary: "Makes span current."
modifiers:
- "default"
parameters:
- description: "Context with span.\n\n <!-- src_embed com.azure.core.util.tracing.makeCurrent -->\n <pre>\n Context span = tracer.start&#40;&quot;EventHubs.process&quot;, new StartSpanOptions&#40;SpanKind.CONSUMER&#41;, Context.NONE&#41;;\n try &#40;AutoCloseable scope = tracer.makeSpanCurrent&#40;span&#41;&#41; &#123;\n doWork&#40;&#41;;\n &#125; catch &#40;Throwable ex&#41; &#123;\n throwable = ex;\n &#125; finally &#123;\n tracer.end&#40;null, throwable, span&#41;;\n &#125;\n </pre>\n <!-- end com.azure.core.util.tracing.makeCurrent -->"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default AutoCloseable makeSpanCurrent(Context context)"
desc: "Makes span current. Implementations may put it on ThreadLocal. Make sure to always use try-with-resource statement with makeSpanCurrent"
returns:
description: "Closeable that should be closed in the same thread with try-with-resource statement."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html\">AutoCloseable</a>"
- uid: "com.azure.core.util.tracing.Tracer.setAttribute(java.lang.String,java.lang.Object,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setAttribute(String key, Object value, Context context)"
name: "setAttribute(String key, Object value, Context context)"
nameWithType: "Tracer.setAttribute(String key, Object value, Context context)"
summary: "Sets an attribute on span."
modifiers:
- "default"
parameters:
- description: "attribute key."
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "attribute value. Note that underlying tracer implementations limit supported value types.\n OpenTelemetry implementation supports following types:\n <ul>\n <li><xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"String\"></xref></li>\n <li><code>int</code></li>\n <li><code>double</code></li>\n <li><code>boolean</code></li>\n <li><code>long</code></li>\n </ul>"
name: "value"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
- description: "context containing span to which attribute is added."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void setAttribute(String key, Object value, Context context)"
desc: "Sets an attribute on span. Adding duplicate attributes, update, or removal is discouraged, since underlying implementations behavior can vary."
- uid: "com.azure.core.util.tracing.Tracer.setAttribute(java.lang.String,java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setAttribute(String key, String value, Context context)"
name: "setAttribute(String key, String value, Context context)"
nameWithType: "Tracer.setAttribute(String key, String value, Context context)"
summary: "Adds metadata to the current span."
modifiers:
- "abstract"
parameters:
- description: "Name of the metadata."
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Value of the metadata."
name: "value"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract void setAttribute(String key, String value, Context context)"
desc: "Adds metadata to the current span. If no span information is found in the context, then no metadata is added.\n\n```java\nspan = tracer.start(\"EventHubs.process\", Context.NONE);\n tracer.setAttribute(\"bar\", \"baz\", span);\n```"
- uid: "com.azure.core.util.tracing.Tracer.setAttribute(java.lang.String,long,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setAttribute(String key, long value, Context context)"
name: "setAttribute(String key, long value, Context context)"
nameWithType: "Tracer.setAttribute(String key, long value, Context context)"
summary: "Sets long attribute."
modifiers:
- "default"
parameters:
- description: "attribute name"
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "atteribute value"
name: "value"
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
- description: "tracing context"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void setAttribute(String key, long value, Context context)"
desc: "Sets long attribute.\n\n```java\nContext span = tracer.start(\"EventHubs.process\", Context.NONE);\n tracer.setAttribute(\"foo\", 42, span);\n```"
- uid: "com.azure.core.util.tracing.Tracer.setSpanName(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setSpanName(String spanName, Context context)"
name: "setSpanName(String spanName, Context context)"
nameWithType: "Tracer.setSpanName(String spanName, Context context)"
summary: "Sets the name for spans that are created."
deprecatedTag: "not needed."
modifiers:
- "default"
parameters:
- description: "Name to give the next span."
name: "spanName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context setSpanName(String spanName, Context context)"
desc: "Sets the name for spans that are created.\n\n**Code samples**\n\nRetrieve the span name of the returned span"
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the name of the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.start(String methodName, Context context)"
name: "start(String methodName, Context context)"
nameWithType: "Tracer.start(String methodName, Context context)"
summary: "Creates a new tracing span."
modifiers:
- "abstract"
parameters:
- description: "Name of the method triggering the span creation."
name: "methodName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract Context start(String methodName, Context context)"
desc: "Creates a new tracing span.\n\nThe `context` will be checked for information about a parent span. If a parent span is found, the new span will be added as a child. Otherwise, the parent span will be created and added to the `context` and any downstream `start()` calls will use the created span as the parent.\n\n**Code samples**\n\nStarts a tracing span with provided method name and explicit parent span\n\n```java\n// start a new tracing span with given name and parent context implicitly propagated\n // in io.opentelemetry.context.Context.current()\n\n Throwable throwable = null;\n Context span = tracer.start(\"keyvault.setsecret\", Context.NONE);\n try {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, span);\n }\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.Context,com.azure.core.util.tracing.ProcessKind)"
fullName: "com.azure.core.util.tracing.Tracer.start(String spanName, Context context, ProcessKind processKind)"
name: "start(String spanName, Context context, ProcessKind processKind)"
nameWithType: "Tracer.start(String spanName, Context context, ProcessKind processKind)"
summary: "Creates a new tracing span for AMQP calls."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.tracing.StartSpanOptions,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#start(String, StartSpanOptions, Context)\"></xref> instead."
modifiers:
- "default"
parameters:
- description: "Name of the method triggering the span creation."
name: "spanName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- description: "AMQP operation kind."
name: "processKind"
type: "<xref href=\"com.azure.core.util.tracing.ProcessKind?alt=com.azure.core.util.tracing.ProcessKind&text=ProcessKind\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context start(String spanName, Context context, ProcessKind processKind)"
desc: "Creates a new tracing span for AMQP calls.\n\nThe `context` will be checked for information about a parent span. If a parent span is found, the new span will be added as a child. Otherwise, the parent span will be created and added to the `context` and any downstream `start()` calls will use the created span as the parent.\n\nSets additional request attributes on the created span when `processKind` is <xref uid=\"com.azure.core.util.tracing.ProcessKind.SEND\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ProcessKind.SEND\"></xref>.\n\nReturns the diagnostic Id and span context of the returned span when `processKind` is <xref uid=\"com.azure.core.util.tracing.ProcessKind.MESSAGE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ProcessKind.MESSAGE\"></xref>.\n\nCreates a new tracing span with remote parent and returns that scope when the given when `processKind` is <xref uid=\"com.azure.core.util.tracing.ProcessKind.PROCESS\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ProcessKind.PROCESS\"></xref>.\n\n**Code samples**\n\nStarts a tracing span with provided method name and AMQP operation SEND"
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.tracing.StartSpanOptions,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.start(String methodName, StartSpanOptions options, Context context)"
name: "start(String methodName, StartSpanOptions options, Context context)"
nameWithType: "Tracer.start(String methodName, StartSpanOptions options, Context context)"
summary: "Creates a new tracing span."
modifiers:
- "default"
parameters:
- description: "Name of the method triggering the span creation."
name: "methodName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "span creation options."
name: "options"
type: "<xref href=\"com.azure.core.util.tracing.StartSpanOptions?alt=com.azure.core.util.tracing.StartSpanOptions&text=StartSpanOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default Context start(String methodName, StartSpanOptions options, Context context)"
desc: "Creates a new tracing span.\n\nThe `context` will be checked for information about a parent span. If a parent span is found, the new span will be added as a child. Otherwise, the parent span will be created and added to the `context` and any downstream `start()` calls will use the created span as the parent.\n\n**Code samples**\n\nStarts a tracing span with provided method name and explicit parent span\n\n```java\n// start a new CLIENT tracing span with the given start options and explicit parent context\n StartSpanOptions options = new StartSpanOptions(SpanKind.CLIENT)\n .setAttribute(\"key\", \"value\");\n Context spanFromOptions = tracer.start(\"keyvault.setsecret\", options, Context.NONE);\n try {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, spanFromOptions);\n }\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
type: "interface"
desc: "Contract that all tracers must implement to be pluggable into the SDK."
metadata: {}
package: "com.azure.core.util.tracing"
artifact: com.azure:azure-core:1.52.0