Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Upgrade gRPC instrumentation for better telemetry
Browse files Browse the repository at this point in the history
Replaced the gRPC server's UnaryInterceptor with StatsHandler from the otelgrpc package for enhanced monitoring capabilities, aligning with best practices for observability. This update allows us to take full advantage of OpenTelemetry's metrics and traces, thereby improving insight into our gRPC server's performance and reliability.

Signed-off-by: SammyOina <[email protected]>
  • Loading branch information
SammyOina committed Jan 24, 2024
1 parent 4a909a1 commit 94b6449
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/server/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func New(ctx context.Context, cancel context.CancelFunc, name string, config ser
func (s *Server) Start() error {
errCh := make(chan error)
grpcServerOptions := []grpc.ServerOption{
grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor()),
grpc.StatsHandler(otelgrpc.NewServerHandler()),
}

listener, err := net.Listen("tcp", s.Address)
Expand Down

0 comments on commit 94b6449

Please sign in to comment.