Skip to content

Commit

Permalink
use otelgrpc.NewServerHandler for instrumenting grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Nov 11, 2023
1 parent 1c8d6aa commit a6bb9be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ func main() {
grpcOpts = append(grpcOpts, grpc.Creds(credentials.NewTLS(tlsConfig)))
}
if useAPIOpentelemetry {
grpcOpts = append(grpcOpts, grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor()))
grpcOpts = append(grpcOpts, grpc.StatsHandler(otelgrpc.NewServerHandler()))
}
grpcErrorMode, err := tools.OptionalStringChoice(viper.GetViper(), "grpc_api_error_mode", []string{transportErrorMode})
if err != nil {
Expand Down

0 comments on commit a6bb9be

Please sign in to comment.