diff --git a/cmd/test_load.go b/cmd/test_load.go index 6dd1d6b66651..61080953aea4 100644 --- a/cmd/test_load.go +++ b/cmd/test_load.go @@ -71,6 +71,7 @@ func loadTest(gs *state.GlobalState, cmd *cobra.Command, args []string) (*loaded Registry: registry, BuiltinMetrics: metrics.RegisterBuiltinMetrics(registry), Events: gs.Events, + TracerProvider: gs.TracerProvider, LookupEnv: func(key string) (string, bool) { val, ok := gs.Env[key] return val, ok diff --git a/js/bundle.go b/js/bundle.go index 0f6943397225..d0e0f3daefc8 100644 --- a/js/bundle.go +++ b/js/bundle.go @@ -122,6 +122,7 @@ func newBundle( global: piState.Events, local: event.NewEventSystem(100, piState.Logger), }, + tracerProvider: piState.TracerProvider, } vuImpl.eventLoop = eventloop.New(vuImpl) exports, err := bundle.instantiate(vuImpl, 0) @@ -237,6 +238,7 @@ func (b *Bundle) Instantiate(ctx context.Context, vuID uint64) (*BundleInstance, global: b.preInitState.Events, local: event.NewEventSystem(100, b.preInitState.Logger), }, + tracerProvider: b.preInitState.TracerProvider, } vuImpl.eventLoop = eventloop.New(vuImpl) exports, err := b.instantiate(vuImpl, vuID) diff --git a/lib/test_state.go b/lib/test_state.go index 370b12103ccc..1067961f1c2a 100644 --- a/lib/test_state.go +++ b/lib/test_state.go @@ -5,6 +5,7 @@ import ( "github.com/sirupsen/logrus" "go.k6.io/k6/event" + "go.k6.io/k6/lib/trace" "go.k6.io/k6/metrics" ) @@ -15,6 +16,7 @@ type TestPreInitState struct { Registry *metrics.Registry BuiltinMetrics *metrics.BuiltinMetrics Events *event.System + TracerProvider *trace.TracerProvider KeyLogger io.Writer LookupEnv func(key string) (val string, ok bool) Logger logrus.FieldLogger