Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
tracing: Unbreak tracing test
Browse files Browse the repository at this point in the history
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 <james.o.hunt@intel.com>
  • Loading branch information
jodh-intel committed Nov 25, 2019
1 parent 562d9fd commit 330cc72
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/katautils/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 330cc72

Please sign in to comment.