public final class ContextUtils extends Object
Context.
Users must interact with the current Context via the public APIs in Tracer and avoid usages of the CONTEXT_SPAN_KEY directly.
| Modifier and Type | Field and Description |
|---|---|
static io.grpc.Context.Key<Span> |
CONTEXT_SPAN_KEY
Deprecated.
from API since 0.21. Use
withValue(Context, Span) and getValue(Context) instead. |
| Modifier and Type | Method and Description |
|---|---|
static Span |
getValue(io.grpc.Context context)
Returns the value from the specified
Context. |
static io.grpc.Context |
withValue(io.grpc.Context context,
Span span)
Creates a new
Context with the given value set. |
@Deprecated public static final io.grpc.Context.Key<Span> CONTEXT_SPAN_KEY
withValue(Context, Span) and getValue(Context) instead.Context.Key used to interact with Context.public static io.grpc.Context withValue(io.grpc.Context context,
@Nullable
Span span)
Context with the given value set.context - the parent Context.span - the value to be set.public static Span getValue(io.grpc.Context context)
Context.context - the specified Context.Context.