tracing: Add span name to logging error

Add span name to logging error to help with debugging when the context
is not set before the span is created.

Fixes #3289

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
Chelsea Mafrica 2021-12-16 12:44:42 -08:00
parent 39cf2b27c1
commit 1653dd4a30

View File

@ -130,7 +130,7 @@ func Trace(parent context.Context, logger *logrus.Entry, name string, tags ...ma
if logger == nil {
logger = kataTraceLogger
}
logger.WithField("type", "bug").Error("trace called before context set")
logger.WithField("type", "bug").WithField("name", name).Error("trace called before context set")
parent = context.Background()
}