Skip to content

Commit

Permalink
fix(grpc.go): convert grpc-trace-bin metadata value to string before …
Browse files Browse the repository at this point in the history
…appending to outgoing context to avoid type error
  • Loading branch information
shumkovdenis committed May 13, 2023
1 parent 0518b71 commit 90a0a94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/integration/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ func (s *GRPCServer) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.Hel
md, _ := metadata.FromIncomingContext(ctx)

log.Println("metadata from incoming context:", md)
log.Println("metadata grpc-trace-bin:", string(md["grpc-trace-bin"][0]))

ctx = metadata.AppendToOutgoingContext(ctx, "dapr-app-id", "remote")
ctx = metadata.AppendToOutgoingContext(ctx, "grpc-trace-bin", md["grpc-trace-bin"][0])
ctx = metadata.AppendToOutgoingContext(ctx, "grpc-trace-bin", string(md["grpc-trace-bin"][0]))

out, err := client.SayHello(ctx, &pb.HelloRequest{Name: in.GetName()})
if err != nil {
Expand Down

0 comments on commit 90a0a94

Please sign in to comment.