diff --git a/pkg/plugins/pluggable/connection.go b/pkg/plugins/pluggable/connection.go index 153803007..1aff49d40 100644 --- a/pkg/plugins/pluggable/connection.go +++ b/pkg/plugins/pluggable/connection.go @@ -148,7 +148,7 @@ func (c *PluginConnection) Start(ctx context.Context, pluginCfg io.Reader) error // Configure gRPC to propagate the span context so the plugin's traces // show up under the current span GRPCDialOptions: []grpc.DialOption{ - grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()), + grpc.WithStatsHandler(otelgrpc.NewClientHandler()), }, }) diff --git a/pkg/plugins/server.go b/pkg/plugins/server.go index ba297bc89..60fd8b2e0 100644 --- a/pkg/plugins/server.go +++ b/pkg/plugins/server.go @@ -29,11 +29,11 @@ func ServeMany(c *portercontext.Context, pluginMap map[int]plugin.PluginSet) { VersionedPlugins: pluginMap, GRPCServer: func(opts []grpc.ServerOption) *grpc.Server { opts = append(opts, + grpc.StatsHandler(otelgrpc.NewServerHandler()), // These handlers are called from left to right. The right-most handler is the one that calls the actual implementation // the grpc_recovery handler should always be last so that it can recover from a panic, and then the other handlers only get // a nice error (created from the panic) to deal with grpc.ChainUnaryInterceptor( - otelgrpc.UnaryServerInterceptor(), makeLogUnaryHandler(c), makePanicHandler()), )