Skip to content

Commit

Permalink
fix(grpc): fix otel server option
Browse files Browse the repository at this point in the history
  • Loading branch information
bradub committed Jun 13, 2024
1 parent 75c5161 commit d7189fb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions grpc/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ type serverOptions struct {
registerGateway registerGatewayFunc
grpcListener net.Listener
unaryServerInterceptors []grpc.UnaryServerInterceptor
dialOptions []grpc.DialOption
errorHandler ErrorHandler
panicHandler PanicHandler
monitorOperationer MonitorOperationer
Expand Down Expand Up @@ -311,9 +310,9 @@ func WithHTTPRoute(method, path string, handler http.HandlerFunc) ServerOption {
// WithOTEL adds the OpenTelemetry instrumentation to the GRPC server.
func WithOTEL() ServerOption {
return newFuncServerOption(func(o *serverOptions) {
o.dialOptions = append(
o.dialOptions,
grpc.WithStatsHandler(otelgrpc.NewServerHandler()),
o.grpcServerOptions = append(
o.grpcServerOptions,
grpc.StatsHandler(otelgrpc.NewServerHandler()),
)
})
}
Expand Down Expand Up @@ -349,7 +348,6 @@ func defaultServerOptions() serverOptions {
registerGateway: nil,
grpcListener: nil,
unaryServerInterceptors: nil,
dialOptions: nil,
errorHandler: nil,
panicHandler: nil,
monitorOperationer: nil,
Expand Down

0 comments on commit d7189fb

Please sign in to comment.