Skip to content

Commit

Permalink
Use run cmd's global ctx in tracer provider init
Browse files Browse the repository at this point in the history
  • Loading branch information
ka3de committed Nov 16, 2023
1 parent ef550a5 commit 663c6c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (c *cmdRun) run(cmd *cobra.Command, args []string) (err error) {
}()
}

if err = c.setupTracerProvider(test); err != nil {
if err = c.setupTracerProvider(globalCtx, test); err != nil {
return err
}
waitTracesFlushed := func() {
Expand Down Expand Up @@ -440,14 +440,14 @@ func (c *cmdRun) flagSet() *pflag.FlagSet {
return flags
}

func (c *cmdRun) setupTracerProvider(test *loadedAndConfiguredTest) error {
func (c *cmdRun) setupTracerProvider(ctx context.Context, test *loadedAndConfiguredTest) error {
ro := test.preInitState.RuntimeOptions
if ro.TracesOutput.String == "none" {
test.preInitState.TracerProvider = trace.NewNoopTracerProvider()
return nil
}

tp, err := trace.TracerProviderFromConfigLine(c.gs.Ctx, ro.TracesOutput.String)
tp, err := trace.TracerProviderFromConfigLine(ctx, ro.TracesOutput.String)
if err != nil {
return err
}
Expand Down

0 comments on commit 663c6c2

Please sign in to comment.