Skip to content

Commit

Permalink
Remove scontainerd.task.v2.Task.Stats span
Browse files Browse the repository at this point in the history
Signed-off-by: Kirtana Ashok <[email protected]>
  • Loading branch information
kiashok committed Jan 10, 2025
1 parent 66a6fc1 commit e60d46c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions internal/oc/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ var _ trace.Exporter = &LogrusExporter{}
// `s.Status.Code != 0` in which case it will be written at `logrus.ErrorLevel`
// providing `s.Status.Message` as the error value.
func (le *LogrusExporter) ExportSpan(s *trace.SpanData) {
// Currently certain spans could flood logs like stats call:
// There are two stats spans generated for every call - one by
// the interceptor call and second by the service.Stats()
// call itself. We can start by not logging the interceptor
// span as it doesn't have any additional information.
switch s.Name {
case "containerd.task.v2.Task.Stats":
return
}

if s.DroppedAnnotationCount > 0 {
logrus.WithFields(logrus.Fields{
"name": s.Name,
Expand Down
1 change: 0 additions & 1 deletion pkg/octtrpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ 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)

var span *trace.Span
opts := []trace.StartOption{trace.WithSampler(o.sampler), oc.WithServerSpanKind}
parent, ok := getParentSpanFromContext(ctx)
Expand Down

0 comments on commit e60d46c

Please sign in to comment.