Class ContextUtils

java.lang.Object
io.opencensus.trace.unsafe.ContextUtils

@Deprecated public final class ContextUtils extends Object
Deprecated.
Please use ContextHandleUtils Util methods/functionality to interact with the Context. Users must interact with the current Context via the public APIs in Tracer and avoid usages of the CONTEXT_SPAN_KEY directly.
Utilities for grabbing manipulating current context and grabbing current span.
Since:
0.5
  • Method Details

    • withValue

      public static io.grpc.Context withValue(io.grpc.Context context, @Nullable Span span)
      Deprecated.
      Creates a new Context with the given value set.
      Parameters:
      context - the parent Context.
      span - the value to be set.
      Returns:
      a new context with the given value set.
      Since:
      0.21
    • getValue

      public static Span getValue(io.grpc.Context context)
      Deprecated.
      Returns the value from the specified Context.
      Parameters:
      context - the specified Context.
      Returns:
      the value from the specified Context.
      Since:
      0.21