Skip to content

Commit

Permalink
Add TracerProvider to VU on bundle instantiate
Browse files Browse the repository at this point in the history
  • Loading branch information
ka3de committed Nov 8, 2023
1 parent f77d243 commit 385989a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/test_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions js/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions lib/test_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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
Expand Down

0 comments on commit 385989a

Please sign in to comment.