Created
February 24, 2022 14:46
-
-
Save TonPC64/83eb7a97b85f8ec9ed60fa7d27c0fe2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *server) SayHello(ctx context.Context, in *api.HelloRequest) (*api.HelloResponse, error) { | |
tracer := otel.GetTracerProvider().Tracer("webserver-grpc") | |
_, span := tracer.Start(ctx, "SayHello-span") | |
defer span.End() | |
fmt.Println(ctx) | |
log.Printf("Received: %v\n", in.GetGreeting()) | |
time.Sleep(50 * time.Millisecond) | |
return &api.HelloResponse{Reply: "Hello " + in.Greeting}, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment