it to context.Context. 10. Extracting Context func (h *serverHandler) TagRPC( ctx context.Context, info *stats.RPCTagInfo, ) context.Context { ctx = extract(ctx, h.config.Propagators) // omitted ctx, _ = h.tracer.Start( trace.ContextWithRemoteSpanContext( ctx, trace.SpanContextFromContext(ctx), ), // omitted ) // omitted return context.WithValue(ctx, gRPCContextKey{}, &gctx) } import ( "google.golang.org/grpc/metadata" "go.opentelemetry.io/otel/propagation" ) func extract( ctx context.Context, propagators propagation.TextMapPropagator, ) context.Context { md, ok := metadata.FromIncomingContext(ctx) if !ok { md = metadata.MD{} } return propagators.Extract(ctx, &metadataSupplier{ metadata: &md, }) }