From 330cc72ef3c580748a2793686937cc06e239630a Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 25 Nov 2019 16:48:41 +0000 Subject: [PATCH] tracing: Unbreak tracing test Force Jaeger to log when it reports traces to ensure the tracing test [1] works as expected. Fixes: #2264. [1] - https://github.com/kata-containers/tests/blob/master/tracing/tracing-test.sh Signed-off-by: James O. D. Hunt --- pkg/katautils/tracing.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/katautils/tracing.go b/pkg/katautils/tracing.go index 481cf830d0..2ed2d78f74 100644 --- a/pkg/katautils/tracing.go +++ b/pkg/katautils/tracing.go @@ -44,6 +44,14 @@ func CreateTracer(name string) (opentracing.Tracer, error) { Type: "const", Param: 1, }, + + // Ensure that Jaeger logs each span. + // This is essential as it is used by: + // + // https: //github.com/kata-containers/tests/blob/master/tracing/tracing-test.sh + Reporter: &config.ReporterConfig{ + LogSpans: tracing, + }, } logger := traceLogger{} @@ -92,6 +100,8 @@ func Trace(parent context.Context, name string) (opentracing.Span, context.Conte // are still created - but the tracer used is a NOP. Therefore, only // display the message when tracing is really enabled. if tracing { + // This log message is *essential*: it is used by: + // https: //github.com/kata-containers/tests/blob/master/tracing/tracing-test.sh kataUtilsLogger.Debugf("created span %v", span) }