Skip to content

Commit ed19c54

Browse files
committed
core/runtime/v2: remove uses of otelgrpc.UnaryClientInterceptor
The otelgrpc.UnaryClientInterceptor and otelgrpc.StreamClientInterceptor options were deprecated and removed in favor of NewClientHandler. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent c4733e7 commit ed19c54

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

core/runtime/v2/shim.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ func makeConnection(ctx context.Context, id string, params client.BootstrapParam
305305
case "grpc":
306306
gopts := []grpc.DialOption{
307307
grpc.WithTransportCredentials(insecure.NewCredentials()),
308-
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), //nolint:staticcheck // Ignore SA1019. Deprecation assumes use of [grpc.NewClient] but we are not using that here.
309-
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()), //nolint:staticcheck // Ignore SA1019. Deprecation assumes use of [grpc.NewClient] but we are not using that here.
308+
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
310309
}
311310
return grpcDialContext(params.Address, onClose, gopts...)
312311
default:

docs/tracing.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ func clientWithTrace() error {
7979

8080
dialOpts := []grpc.DialOption{
8181
grpc.WithTransportCredentials(insecure.NewCredentials()),
82-
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()),
83-
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()),
82+
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
8483
}
8584
client, ctx, cancel, err := commands.NewClient(context, containerd.WithDialOpts(dialOpts))
8685
if err != nil {

0 commit comments

Comments
 (0)