diff --git a/cmd/containerd-shim-runhcs-v1/service.go b/cmd/containerd-shim-runhcs-v1/service.go index b8f1e48c8c..920be5d073 100644 --- a/cmd/containerd-shim-runhcs-v1/service.go +++ b/cmd/containerd-shim-runhcs-v1/service.go @@ -434,16 +434,6 @@ func (s *service) Wait(ctx context.Context, req *task.WaitRequest) (resp *task.W } func (s *service) Stats(ctx context.Context, req *task.StatsRequest) (_ *task.StatsResponse, err error) { - ctx, span := oc.StartSpan(ctx, "Stats") - defer span.End() - defer func() { oc.SetSpanStatus(span, err) }() - - span.AddAttributes(trace.StringAttribute("tid", req.ID)) - - if s.isSandbox { - span.AddAttributes(trace.StringAttribute("pod-id", s.tid)) - } - r, e := s.statsInternal(ctx, req) return r, errdefs.ToGRPC(e) } diff --git a/pkg/octtrpc/interceptor.go b/pkg/octtrpc/interceptor.go index 673b29b5a6..2965ae21b7 100644 --- a/pkg/octtrpc/interceptor.go +++ b/pkg/octtrpc/interceptor.go @@ -101,6 +101,10 @@ func ServerInterceptor(opts ...Option) ttrpc.UnaryServerInterceptor { return func(ctx context.Context, unmarshal ttrpc.Unmarshaler, info *ttrpc.UnaryServerInfo, method ttrpc.Method) (_ interface{}, err error) { name := convertMethodName(info.FullMethod) + if name == "containerd.task.v2.Task.Stats" { + return method(ctx, unmarshal) + } + var span *trace.Span opts := []trace.StartOption{trace.WithSampler(o.sampler), oc.WithServerSpanKind} parent, ok := getParentSpanFromContext(ctx)