Skip to content

Commit 45c3e62

Browse files
authored
Upgrade otelgrpc to v0.46.1 (#1689)
The otelgrpc upstream fixed a recent regression which allows us to upgrade to the latest version.
1 parent 6237753 commit 45c3e62

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ require (
5050
github.com/sqlc-dev/pqtype v0.3.0
5151
github.com/stretchr/testify v1.8.4
5252
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
5454
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
5555
go.opentelemetry.io/otel v1.21.0
5656
go.opentelemetry.io/otel/exporters/prometheus v0.43.0

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,8 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
10901090
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
10911091
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 h1:RsQi0qJ2imFfCvZabqzM9cNXBG8k6gXMv1A0cXRmH6A=
10921092
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=
10931095
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24=
10941096
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo=
10951097
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=

internal/controlplane/server.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,19 @@ func (s *Server) StartGRPCServer(ctx context.Context) error {
200200
logger.Interceptor(),
201201
AuthUnaryInterceptor,
202202
}
203+
204+
options := []grpc.ServerOption{
205+
grpc.Creds(insecure.NewCredentials()),
206+
grpc.ChainUnaryInterceptor(interceptors...),
207+
}
208+
203209
otelGRPCOpts := s.getOTELGRPCInterceptorOpts()
204210
if len(otelGRPCOpts) > 0 {
205-
interceptors = append(interceptors, otelgrpc.UnaryServerInterceptor(otelGRPCOpts...))
211+
options = append(options, grpc.StatsHandler(otelgrpc.NewServerHandler()))
206212
}
207213

208214
s.grpcServer = grpc.NewServer(
209-
grpc.Creds(insecure.NewCredentials()),
210-
grpc.ChainUnaryInterceptor(interceptors...),
215+
options...,
211216
)
212217

213218
// register the services (declared within register_handlers.go)

0 commit comments

Comments
 (0)