Skip to content

Commit

Permalink
feat: add NewVariableContext for StreamInterceptorFilter (#1055)
Browse files Browse the repository at this point in the history
* add NewVariableContext for StreamInterceptorFilter

* fix go lint

---------

Co-authored-by: 文徐 <[email protected]>
  • Loading branch information
wenxuwan and 文徐 authored Jul 4, 2024
1 parent 4c666d8 commit 3bf8bca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions diagnostics/grpc_tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"google.golang.org/grpc"
"mosn.io/mosn/pkg/trace"
"mosn.io/pkg/variable"

ltrace "mosn.io/layotto/components/trace"
lgrpc "mosn.io/layotto/diagnostics/grpc"
Expand Down Expand Up @@ -50,6 +51,7 @@ func StreamInterceptorFilter(srv interface{}, ss grpc.ServerStream, info *grpc.S
// get tracer
tracer := trace.Tracer(protocol.Layotto)
ctx := ss.Context()
ctx = variable.NewVariableContext(ctx)
// start a span
span := tracer.Start(ctx, &lgrpc.RequestInfo{
FullMethod: info.FullMethod,
Expand Down

0 comments on commit 3bf8bca

Please sign in to comment.