Skip to content

Commit

Permalink
Remove stats span
Browse files Browse the repository at this point in the history
Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
  • Loading branch information
kiashok committed Dec 3, 2024
1 parent 66a6fc1 commit 637a294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 0 additions & 10 deletions cmd/containerd-shim-runhcs-v1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/octtrpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 637a294

Please sign in to comment.