Refactor trace config to match supported otel options

This commit is contained in:
Joe Kralicky 2025-01-24 19:52:04 +00:00
parent c307ca806a
commit c510edf364
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
21 changed files with 991 additions and 701 deletions

View file

@ -323,6 +323,7 @@ func New(t testing.TB, opts ...EnvironmentOption) Environment {
pauseOnFailure: *flagPauseOnFailure,
forceSilent: *flagSilent,
traceDebugFlags: trace.DebugFlags(defaultTraceDebugFlags),
traceClient: trace.NoopClient{},
}
options.apply(opts...)
if testing.Short() {
@ -368,9 +369,8 @@ func New(t testing.TB, opts ...EnvironmentOption) Environment {
logger := zerolog.New(writer).With().Timestamp().Logger().Level(zerolog.DebugLevel)
ctx := trace.Options{
DebugFlags: options.traceDebugFlags,
RemoteClient: options.traceClient,
}.NewContext(logger.WithContext(context.Background()))
DebugFlags: options.traceDebugFlags,
}.NewContext(logger.WithContext(context.Background()), options.traceClient)
tracerProvider := trace.NewTracerProvider(ctx, "Test Environment")
tracer := tracerProvider.Tracer(trace.PomeriumCoreTracer)
ctx, span := tracer.Start(ctx, t.Name(), oteltrace.WithNewRoot())