File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ require (
50
50
github.com/sqlc-dev/pqtype v0.3.0
51
51
github.com/stretchr/testify v1.8.4
52
52
github.com/xeipuuv/gojsonschema v1.2.0
53
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0
53
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
54
54
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
55
55
go.opentelemetry.io/otel v1.21.0
56
56
go.opentelemetry.io/otel/exporters/prometheus v0.43.0
Original file line number Diff line number Diff line change @@ -1090,6 +1090,8 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
1090
1090
go.opencensus.io v0.24.0 /go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo =
1091
1091
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 h1:RsQi0qJ2imFfCvZabqzM9cNXBG8k6gXMv1A0cXRmH6A =
1092
1092
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 /go.mod h1:vsh3ySueQCiKPxFLvjWC4Z135gIa34TQ/NSqkDTZYUM =
1093
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE =
1094
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 /go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE =
1093
1095
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24 =
1094
1096
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 /go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo =
1095
1097
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc =
Original file line number Diff line number Diff line change @@ -200,14 +200,19 @@ func (s *Server) StartGRPCServer(ctx context.Context) error {
200
200
logger .Interceptor (),
201
201
AuthUnaryInterceptor ,
202
202
}
203
+
204
+ options := []grpc.ServerOption {
205
+ grpc .Creds (insecure .NewCredentials ()),
206
+ grpc .ChainUnaryInterceptor (interceptors ... ),
207
+ }
208
+
203
209
otelGRPCOpts := s .getOTELGRPCInterceptorOpts ()
204
210
if len (otelGRPCOpts ) > 0 {
205
- interceptors = append (interceptors , otelgrpc . UnaryServerInterceptor ( otelGRPCOpts ... ))
211
+ options = append (options , grpc . StatsHandler ( otelgrpc . NewServerHandler () ))
206
212
}
207
213
208
214
s .grpcServer = grpc .NewServer (
209
- grpc .Creds (insecure .NewCredentials ()),
210
- grpc .ChainUnaryInterceptor (interceptors ... ),
215
+ options ... ,
211
216
)
212
217
213
218
// register the services (declared within register_handlers.go)
You can’t perform that action at this time.
0 commit comments