Class ContextStorageBridge

java.lang.Object
io.grpc.Context.Storage
io.opentelemetry.instrumentation.grpc.v1_6.internal.ContextStorageBridge

public final class ContextStorageBridge extends io.grpc.Context.Storage
Context.Storage override which uses OpenTelemetry context as the backing store. Both gRPC and OpenTelemetry contexts refer to each other to ensure that both OTel context propagation mechanisms and gRPC context propagation mechanisms can be used interchangeably.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Constructor Details

    • ContextStorageBridge

      public ContextStorageBridge(boolean propagateGrpcDeadline)
    • ContextStorageBridge

      public ContextStorageBridge(io.grpc.Context.Storage originalStorage)
  • Method Details

    • doAttach

      public io.grpc.Context doAttach(io.grpc.Context toAttach)
      Overrides:
      doAttach in class io.grpc.Context.Storage
    • detach

      public void detach(io.grpc.Context toDetach, io.grpc.Context toRestore)
      Specified by:
      detach in class io.grpc.Context.Storage
    • current

      public io.grpc.Context current()
      Specified by:
      current in class io.grpc.Context.Storage