From b3ab9cafc145e6fed99e85a82f5b91fb4f25906c Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Wed, 19 Jun 2019 11:46:13 +0100 Subject: [PATCH] trace: Add missing log message Add a log message for every trace span created, required by the tracing tests to validate tracing is working. Fixes: #1814. Signed-off-by: James O. D. Hunt --- pkg/katautils/tracing.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/katautils/tracing.go b/pkg/katautils/tracing.go index 10d95ce3fc..481cf830d0 100644 --- a/pkg/katautils/tracing.go +++ b/pkg/katautils/tracing.go @@ -88,5 +88,12 @@ func Trace(parent context.Context, name string) (opentracing.Span, context.Conte span.SetTag("source", "runtime") span.SetTag("component", "cli") + // This is slightly confusing: when tracing is disabled, trace spans + // are still created - but the tracer used is a NOP. Therefore, only + // display the message when tracing is really enabled. + if tracing { + kataUtilsLogger.Debugf("created span %v", span) + } + return span, ctx }