diff --git a/samplers/jaegerremote/sampler_remote_options.go b/samplers/jaegerremote/sampler_remote_options.go index 17e74879759..cc80e3aad17 100644 --- a/samplers/jaegerremote/sampler_remote_options.go +++ b/samplers/jaegerremote/sampler_remote_options.go @@ -49,13 +49,13 @@ func newConfig(options ...Option) config { OperationNameLateBinding: defaultSamplingOperationNameLateBinding, }, } + for _, option := range options { + option.apply(&c) + } c.updaters = append([]samplerUpdater{&perOperationSamplerUpdater{ MaxOperations: c.posParams.MaxOperations, OperationNameLateBinding: c.posParams.OperationNameLateBinding, }}, c.updaters...) - for _, option := range options { - option.apply(&c) - } return c } diff --git a/samplers/jaegerremote/sampler_remote_test.go b/samplers/jaegerremote/sampler_remote_test.go index bdb610c69a8..47db9c68d81 100644 --- a/samplers/jaegerremote/sampler_remote_test.go +++ b/samplers/jaegerremote/sampler_remote_test.go @@ -125,7 +125,7 @@ func TestRemoteSamplerOptions(t *testing.T) { assert.Equal(t, 42*time.Second, sampler.samplingRefreshInterval) assert.Same(t, fetcher, sampler.samplingFetcher) assert.Same(t, parser, sampler.samplingParser) - assert.Same(t, updaters[0], sampler.updaters[0]) + assert.EqualValues(t, sampler.updaters[0], &perOperationSamplerUpdater{MaxOperations: 42, OperationNameLateBinding: true}) } func TestRemoteSamplerOptionsDefaults(t *testing.T) {