Modifier and Type | Method and Description |
---|---|
static void |
end(int responseCode,
Throwable error,
Context context)
For the plugged in
tracer , its current tracing span is marked as completed. |
static boolean |
isTracingEnabled()
Returns true if tracing is enabled.
|
static void |
setAttribute(String key,
String value,
Context context)
For the plugged in
tracer , the key-value pair metadata is added to its current span. |
static Context |
setSpanName(String spanName,
Context context)
Sets the span name for each
tracer plugged into the SDK. |
static Context |
start(String methodName,
Context context)
A new tracing span with INTERNAL kind is created for each
tracer plugged into the SDK. |
static Context |
start(String methodName,
StartSpanOptions spanOptions,
Context context)
A new tracing span is created for each
tracer plugged into the SDK. |
public static Context start(String methodName, Context context)
tracer
plugged into the SDK.
The 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.
methodName
- Name of the method triggering the span creation.context
- Additional metadata that is passed through the call stack.Context
object.public static Context start(String methodName, StartSpanOptions spanOptions, Context context)
tracer
plugged into the SDK.
The 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.
methodName
- Name of the method triggering the span creation.spanOptions
- span creation options.context
- Additional metadata that is passed through the call stack.Context
object.public static void setAttribute(String key, String value, Context context)
tracer
, the key-value pair metadata is added to its current span. If the context
does not contain a span, then no metadata is added.key
- Name of the metadata.value
- Value of the metadata.context
- Additional metadata that is passed through the call stack.public static void end(int responseCode, Throwable error, Context context)
tracer
, its current tracing span is marked as completed.responseCode
- Response status code if the span is in an HTTP call context.error
- Throwable
that happened during the span or null
if no exception occurred.context
- Additional metadata that is passed through the call stack.public static Context setSpanName(String spanName, Context context)
tracer
plugged into the SDK.spanName
- Name of the span.context
- Additional metadata that is passed through the call stack.Context
object.public static boolean isTracingEnabled()
Copyright © 2021 Microsoft Corporation. All rights reserved.