-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tasks): remove flux stats from run log and replace with trace id (…
…#16263) * feat(tasks): trace id in task run logs * refactor(tracing): move trace info utility into kit/tracing package
- Loading branch information
Showing
9 changed files
with
115 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package testing | ||
|
||
import ( | ||
"github.com/opentracing/opentracing-go" | ||
"github.com/uber/jaeger-client-go" | ||
) | ||
|
||
// SetupInMemoryTracing sets the global tracer to an in memory Jaeger instance for testing. | ||
// The returned function should be deferred by the caller to tear down this setup after testing is complete. | ||
func SetupInMemoryTracing(name string) func() { | ||
var ( | ||
old = opentracing.GlobalTracer() | ||
tracer, closer = jaeger.NewTracer(name, | ||
jaeger.NewConstSampler(true), | ||
jaeger.NewInMemoryReporter(), | ||
) | ||
) | ||
|
||
opentracing.SetGlobalTracer(tracer) | ||
return func() { | ||
_ = closer.Close() | ||
opentracing.SetGlobalTracer(old) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters