diff --git a/processor/agentmetricsprocessor/agentmetricsprocessor_test.go b/processor/agentmetricsprocessor/agentmetricsprocessor_test.go index a7774bada..bbbb95c0d 100644 --- a/processor/agentmetricsprocessor/agentmetricsprocessor_test.go +++ b/processor/agentmetricsprocessor/agentmetricsprocessor_test.go @@ -100,7 +100,7 @@ func TestAgentMetricsProcessor(t *testing.T) { tmn := &consumertest.MetricsSink{} rmp, err := processorhelper.NewMetricsProcessor( context.Background(), - processortest.NewNopCreateSettings(), + processortest.NewNopSettings(), &Config{}, tmn, amp.ProcessMetrics, diff --git a/processor/agentmetricsprocessor/factory.go b/processor/agentmetricsprocessor/factory.go index 01c5dde3a..b1cf05770 100644 --- a/processor/agentmetricsprocessor/factory.go +++ b/processor/agentmetricsprocessor/factory.go @@ -41,7 +41,7 @@ var processorCapabilities = consumer.Capabilities{MutatesData: true} func createMetricsProcessor( ctx context.Context, - params processor.CreateSettings, + params processor.Settings, cfg component.Config, nextConsumer consumer.Metrics, ) (processor.Metrics, error) { diff --git a/processor/agentmetricsprocessor/factory_test.go b/processor/agentmetricsprocessor/factory_test.go index 6ea8fd2d5..108551068 100644 --- a/processor/agentmetricsprocessor/factory_test.go +++ b/processor/agentmetricsprocessor/factory_test.go @@ -29,7 +29,7 @@ func TestCreateDefaultConfig(t *testing.T) { } func TestCreateProcessor(t *testing.T) { - mp, err := createMetricsProcessor(context.Background(), processor.CreateSettings{}, createDefaultConfig(), consumertest.NewNop()) + mp, err := createMetricsProcessor(context.Background(), processor.Settings{}, createDefaultConfig(), consumertest.NewNop()) assert.NoError(t, err) assert.NotNil(t, mp) } diff --git a/processor/casttosumprocessor/factory.go b/processor/casttosumprocessor/factory.go index e08452fcd..d95e4303d 100644 --- a/processor/casttosumprocessor/factory.go +++ b/processor/casttosumprocessor/factory.go @@ -42,7 +42,7 @@ var processorCapabilities = consumer.Capabilities{MutatesData: true} func createMetricsProcessor( ctx context.Context, - params processor.CreateSettings, + params processor.Settings, cfg component.Config, nextConsumer consumer.Metrics, ) (processor.Metrics, error) { diff --git a/processor/casttosumprocessor/factory_test.go b/processor/casttosumprocessor/factory_test.go index 3c48f7758..357c1c32d 100644 --- a/processor/casttosumprocessor/factory_test.go +++ b/processor/casttosumprocessor/factory_test.go @@ -41,7 +41,7 @@ func TestCreateProcessor(t *testing.T) { assert.NotNil(t, config) for _, cfg := range config.Processors { - mp, err := createMetricsProcessor(context.Background(), processor.CreateSettings{}, cfg, consumertest.NewNop()) + mp, err := createMetricsProcessor(context.Background(), processor.Settings{}, cfg, consumertest.NewNop()) assert.NoError(t, err) assert.NotNil(t, mp) } diff --git a/processor/casttosumprocessor/processor_test.go b/processor/casttosumprocessor/processor_test.go index 17712e52d..83197b519 100644 --- a/processor/casttosumprocessor/processor_test.go +++ b/processor/casttosumprocessor/processor_test.go @@ -88,7 +88,7 @@ func TestCastToSumProcessor(t *testing.T) { tmn := &consumertest.MetricsSink{} rmp, err := processorhelper.NewMetricsProcessor( context.Background(), - processortest.NewNopCreateSettings(), + processortest.NewNopSettings(), cfg, tmn, nsp.ProcessMetrics, diff --git a/processor/modifyscopeprocessor/factory.go b/processor/modifyscopeprocessor/factory.go index b50eace81..d3a0a923b 100644 --- a/processor/modifyscopeprocessor/factory.go +++ b/processor/modifyscopeprocessor/factory.go @@ -41,7 +41,7 @@ var processorCapabilities = consumer.Capabilities{MutatesData: true} func createMetricsProcessor( ctx context.Context, - params processor.CreateSettings, + params processor.Settings, cfg component.Config, nextConsumer consumer.Metrics, ) (processor.Metrics, error) { diff --git a/processor/modifyscopeprocessor/factory_test.go b/processor/modifyscopeprocessor/factory_test.go index c5807db7e..03f3f8756 100644 --- a/processor/modifyscopeprocessor/factory_test.go +++ b/processor/modifyscopeprocessor/factory_test.go @@ -28,7 +28,7 @@ func TestCreateDefaultConfig(t *testing.T) { assert.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())) } func TestCreateProcessor(t *testing.T) { - mp, err := createMetricsProcessor(context.Background(), processor.CreateSettings{}, createDefaultConfig(), consumertest.NewNop()) + mp, err := createMetricsProcessor(context.Background(), processor.Settings{}, createDefaultConfig(), consumertest.NewNop()) assert.NoError(t, err) assert.NotNil(t, mp) } diff --git a/processor/modifyscopeprocessor/processor_test.go b/processor/modifyscopeprocessor/processor_test.go index a65a4dcdd..12f5cb293 100644 --- a/processor/modifyscopeprocessor/processor_test.go +++ b/processor/modifyscopeprocessor/processor_test.go @@ -53,7 +53,7 @@ func TestModifyScopeProcessor(t *testing.T) { tmn := &consumertest.MetricsSink{} rmp, err := processorhelper.NewMetricsProcessor( context.Background(), - processortest.NewNopCreateSettings(), + processortest.NewNopSettings(), cfg, tmn, msp.ProcessMetrics, diff --git a/processor/normalizesumsprocessor/factory.go b/processor/normalizesumsprocessor/factory.go index 4ee491b61..02a142548 100644 --- a/processor/normalizesumsprocessor/factory.go +++ b/processor/normalizesumsprocessor/factory.go @@ -41,7 +41,7 @@ var processorCapabilities = consumer.Capabilities{MutatesData: true} func createMetricsProcessor( ctx context.Context, - params processor.CreateSettings, + params processor.Settings, cfg component.Config, nextConsumer consumer.Metrics, ) (processor.Metrics, error) { diff --git a/processor/normalizesumsprocessor/factory_test.go b/processor/normalizesumsprocessor/factory_test.go index 37eccc5a7..b98f82846 100644 --- a/processor/normalizesumsprocessor/factory_test.go +++ b/processor/normalizesumsprocessor/factory_test.go @@ -28,7 +28,7 @@ func TestCreateDefaultConfig(t *testing.T) { assert.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())) } func TestCreateProcessor(t *testing.T) { - mp, err := createMetricsProcessor(context.Background(), processor.CreateSettings{}, createDefaultConfig(), consumertest.NewNop()) + mp, err := createMetricsProcessor(context.Background(), processor.Settings{}, createDefaultConfig(), consumertest.NewNop()) assert.NoError(t, err) assert.NotNil(t, mp) } diff --git a/processor/normalizesumsprocessor/processor_test.go b/processor/normalizesumsprocessor/processor_test.go index 4e3115cea..6ece175ad 100644 --- a/processor/normalizesumsprocessor/processor_test.go +++ b/processor/normalizesumsprocessor/processor_test.go @@ -80,7 +80,7 @@ func TestNormalizeSumsProcessor(t *testing.T) { tmn := &consumertest.MetricsSink{} rmp, err := processorhelper.NewMetricsProcessor( context.Background(), - processortest.NewNopCreateSettings(), + processortest.NewNopSettings(), &Config{}, tmn, nsp.ProcessMetrics, diff --git a/receiver/dcgmreceiver/component_test.go b/receiver/dcgmreceiver/component_test.go index 18ad1e214..7f7984af9 100644 --- a/receiver/dcgmreceiver/component_test.go +++ b/receiver/dcgmreceiver/component_test.go @@ -50,12 +50,12 @@ func TestComponentLifecycle(t *testing.T) { tests := []struct { name string - createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + createFn func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) }{ { name: "metrics", - createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) }, }, @@ -70,19 +70,19 @@ func TestComponentLifecycle(t *testing.T) { for _, test := range tests { t.Run(test.name+"-shutdown", func(t *testing.T) { - c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + c, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() require.NoError(t, err) require.NoError(t, firstRcvr.Start(context.Background(), host)) require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondRcvr.Start(context.Background(), host)) require.NoError(t, secondRcvr.Shutdown(context.Background())) diff --git a/receiver/dcgmreceiver/factory_gpu_off.go b/receiver/dcgmreceiver/factory_gpu_off.go index 523c4447b..7115e0281 100644 --- a/receiver/dcgmreceiver/factory_gpu_off.go +++ b/receiver/dcgmreceiver/factory_gpu_off.go @@ -29,7 +29,7 @@ import ( func createMetricsReceiver( _ context.Context, - _ receiver.CreateSettings, + _ receiver.Settings, _ component.Config, _ consumer.Metrics, ) (receiver.Metrics, error) { diff --git a/receiver/dcgmreceiver/factory_gpu_off_test.go b/receiver/dcgmreceiver/factory_gpu_off_test.go index f2a7239b7..cca58f45a 100644 --- a/receiver/dcgmreceiver/factory_gpu_off_test.go +++ b/receiver/dcgmreceiver/factory_gpu_off_test.go @@ -34,7 +34,7 @@ func TestCreateMetricsReceiverWithGPUSupportOff(t *testing.T) { cfg := factory.CreateDefaultConfig() receiver, err := factory.CreateMetricsReceiver( context.Background(), - receivertest.NewNopCreateSettings(), + receivertest.NewNopSettings(), cfg, consumertest.NewNop()) diff --git a/receiver/dcgmreceiver/factory_gpu_on.go b/receiver/dcgmreceiver/factory_gpu_on.go index 08295aa12..c694d86f2 100644 --- a/receiver/dcgmreceiver/factory_gpu_on.go +++ b/receiver/dcgmreceiver/factory_gpu_on.go @@ -68,7 +68,7 @@ func init() { func createMetricsReceiver( _ context.Context, - params receiver.CreateSettings, + params receiver.Settings, rConf component.Config, consumer consumer.Metrics, ) (receiver.Metrics, error) { diff --git a/receiver/dcgmreceiver/factory_gpu_on_test.go b/receiver/dcgmreceiver/factory_gpu_on_test.go index 7f4ccc529..95f3d8503 100644 --- a/receiver/dcgmreceiver/factory_gpu_on_test.go +++ b/receiver/dcgmreceiver/factory_gpu_on_test.go @@ -33,7 +33,7 @@ func TestCreateMetricsReceiverOnLinux(t *testing.T) { receiver, err := factory.CreateMetricsReceiver( context.Background(), - receivertest.NewNopCreateSettings(), + receivertest.NewNopSettings(), receiverConfig, consumertest.NewNop(), ) diff --git a/receiver/dcgmreceiver/internal/metadata/generated_metrics.go b/receiver/dcgmreceiver/internal/metadata/generated_metrics.go index 6d681ee43..d57c78d14 100644 --- a/receiver/dcgmreceiver/internal/metadata/generated_metrics.go +++ b/receiver/dcgmreceiver/internal/metadata/generated_metrics.go @@ -553,7 +553,7 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { } } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ config: mbc, startTime: pcommon.NewTimestampFromTime(time.Now()), diff --git a/receiver/dcgmreceiver/internal/metadata/generated_metrics_test.go b/receiver/dcgmreceiver/internal/metadata/generated_metrics_test.go index 0b68d49bd..5091a4722 100644 --- a/receiver/dcgmreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/dcgmreceiver/internal/metadata/generated_metrics_test.go @@ -48,7 +48,7 @@ func TestMetricsBuilder(t *testing.T) { start := pcommon.Timestamp(1_000_000_000) ts := pcommon.Timestamp(1_000_001_000) observedZapCore, observedLogs := observer.New(zap.WarnLevel) - settings := receivertest.NewNopCreateSettings() + settings := receivertest.NewNopSettings() settings.Logger = zap.New(observedZapCore) mb := NewMetricsBuilder(loadMetricsBuilderConfig(t, test.name), settings, WithStartTime(start)) diff --git a/receiver/dcgmreceiver/scraper.go b/receiver/dcgmreceiver/scraper.go index 2768e50d9..d2c212b80 100644 --- a/receiver/dcgmreceiver/scraper.go +++ b/receiver/dcgmreceiver/scraper.go @@ -33,12 +33,12 @@ import ( type dcgmScraper struct { config *Config - settings receiver.CreateSettings + settings receiver.Settings client *dcgmClient mb *metadata.MetricsBuilder } -func newDcgmScraper(config *Config, settings receiver.CreateSettings) *dcgmScraper { +func newDcgmScraper(config *Config, settings receiver.Settings) *dcgmScraper { return &dcgmScraper{config: config, settings: settings} } diff --git a/receiver/dcgmreceiver/scraper_gpu_test.go b/receiver/dcgmreceiver/scraper_gpu_test.go index e0a3584f2..fa53a061f 100644 --- a/receiver/dcgmreceiver/scraper_gpu_test.go +++ b/receiver/dcgmreceiver/scraper_gpu_test.go @@ -38,7 +38,7 @@ import ( ) func TestScrapeWithGpuPresent(t *testing.T) { - var settings receiver.CreateSettings + var settings receiver.Settings settings.Logger = zaptest.NewLogger(t) scraper := newDcgmScraper(createDefaultConfig().(*Config), settings) @@ -59,7 +59,7 @@ func TestScrapeWithDelayedDcgmService(t *testing.T) { return nil, fmt.Errorf("No DCGM client library *OR* No DCGM connection") } - var settings receiver.CreateSettings + var settings receiver.Settings settings.Logger = zaptest.NewLogger(t) scraper := newDcgmScraper(createDefaultConfig().(*Config), settings) @@ -86,7 +86,7 @@ func TestScrapeWithDelayedDcgmService(t *testing.T) { } func TestScrapeWithEmptyMetricsConfig(t *testing.T) { - var settings receiver.CreateSettings + var settings receiver.Settings settings.Logger = zaptest.NewLogger(t) emptyConfig := &Config{ ControllerConfig: scraperhelper.ControllerConfig{ @@ -141,7 +141,7 @@ func TestScrapeOnPollingError(t *testing.T) { return nil, fmt.Errorf("DCGM polling error") } - var settings receiver.CreateSettings + var settings receiver.Settings settings.Logger = zaptest.NewLogger(t) scraper := newDcgmScraper(createDefaultConfig().(*Config), settings) @@ -160,7 +160,7 @@ func TestScrapeOnProfilingPaused(t *testing.T) { config := createDefaultConfig().(*Config) config.CollectionInterval = 10 * time.Millisecond - var settings receiver.CreateSettings + var settings receiver.Settings settings.Logger = zaptest.NewLogger(t) scraper := newDcgmScraper(config, settings) diff --git a/receiver/dcgmreceiver/scraper_test.go b/receiver/dcgmreceiver/scraper_test.go index b4900aaa1..bc7b3d93d 100644 --- a/receiver/dcgmreceiver/scraper_test.go +++ b/receiver/dcgmreceiver/scraper_test.go @@ -32,7 +32,7 @@ import ( ) func TestScraperWithoutDcgm(t *testing.T) { - var settings receiver.CreateSettings + var settings receiver.Settings seenDcgmNotInstalledWarning := false settings.Logger = zaptest.NewLogger(t, zaptest.WrapOptions(zap.Hooks(func(e zapcore.Entry) error { if e.Level == zap.WarnLevel && strings.Contains(e.Message, "Unable to connect to DCGM daemon at localhost:5555 on libdcgm.so not Found; Is the DCGM daemon running") { diff --git a/receiver/mongodbreceiver/factory.go b/receiver/mongodbreceiver/factory.go index 1937ae965..b1ed7baf9 100644 --- a/receiver/mongodbreceiver/factory.go +++ b/receiver/mongodbreceiver/factory.go @@ -55,7 +55,7 @@ func createDefaultConfig() component.Config { func createMetricsReceiver( _ context.Context, - params receiver.CreateSettings, + params receiver.Settings, rConf component.Config, consumer consumer.Metrics, ) (receiver.Metrics, error) { diff --git a/receiver/mongodbreceiver/factory_test.go b/receiver/mongodbreceiver/factory_test.go index 537930cc0..aab31a14c 100644 --- a/receiver/mongodbreceiver/factory_test.go +++ b/receiver/mongodbreceiver/factory_test.go @@ -42,7 +42,7 @@ func TestCreateMetricsReceiver(t *testing.T) { factory := NewFactory() _, err := factory.CreateMetricsReceiver( context.Background(), - receivertest.NewNopCreateSettings(), + receivertest.NewNopSettings(), &Config{ ControllerConfig: scraperhelper.ControllerConfig{ CollectionInterval: 10 * time.Second, diff --git a/receiver/mongodbreceiver/generated_component_test.go b/receiver/mongodbreceiver/generated_component_test.go index db51eb06c..2ab097eb0 100644 --- a/receiver/mongodbreceiver/generated_component_test.go +++ b/receiver/mongodbreceiver/generated_component_test.go @@ -28,12 +28,12 @@ func TestComponentLifecycle(t *testing.T) { tests := []struct { name string - createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + createFn func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) }{ { name: "metrics", - createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) }, }, @@ -48,19 +48,19 @@ func TestComponentLifecycle(t *testing.T) { for _, test := range tests { t.Run(test.name+"-shutdown", func(t *testing.T) { - c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + c, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() require.NoError(t, err) require.NoError(t, firstRcvr.Start(context.Background(), host)) require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondRcvr.Start(context.Background(), host)) require.NoError(t, secondRcvr.Shutdown(context.Background())) diff --git a/receiver/mongodbreceiver/internal/metadata/generated_metrics.go b/receiver/mongodbreceiver/internal/metadata/generated_metrics.go index 9555d52d1..db232f0af 100644 --- a/receiver/mongodbreceiver/internal/metadata/generated_metrics.go +++ b/receiver/mongodbreceiver/internal/metadata/generated_metrics.go @@ -1642,7 +1642,7 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { } } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ config: mbc, startTime: pcommon.NewTimestampFromTime(time.Now()), diff --git a/receiver/mongodbreceiver/internal/metadata/generated_metrics_test.go b/receiver/mongodbreceiver/internal/metadata/generated_metrics_test.go index d4a2b8d9e..7da5462ea 100644 --- a/receiver/mongodbreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/mongodbreceiver/internal/metadata/generated_metrics_test.go @@ -57,7 +57,7 @@ func TestMetricsBuilder(t *testing.T) { start := pcommon.Timestamp(1_000_000_000) ts := pcommon.Timestamp(1_000_001_000) observedZapCore, observedLogs := observer.New(zap.WarnLevel) - settings := receivertest.NewNopCreateSettings() + settings := receivertest.NewNopSettings() settings.Logger = zap.New(observedZapCore) mb := NewMetricsBuilder(loadMetricsBuilderConfig(t, test.name), settings, WithStartTime(start)) diff --git a/receiver/mongodbreceiver/scraper.go b/receiver/mongodbreceiver/scraper.go index 9b722accc..b9b4c1dc6 100644 --- a/receiver/mongodbreceiver/scraper.go +++ b/receiver/mongodbreceiver/scraper.go @@ -40,7 +40,7 @@ type mongodbScraper struct { mb *metadata.MetricsBuilder } -func newMongodbScraper(settings receiver.CreateSettings, config *Config) *mongodbScraper { +func newMongodbScraper(settings receiver.Settings, config *Config) *mongodbScraper { mbConfig := metadata.DefaultMetricsBuilderConfig() mbConfig.Metrics = config.Metrics return &mongodbScraper{ diff --git a/receiver/nvmlreceiver/component_test.go b/receiver/nvmlreceiver/component_test.go index 5a7487aee..485e9677f 100644 --- a/receiver/nvmlreceiver/component_test.go +++ b/receiver/nvmlreceiver/component_test.go @@ -50,12 +50,12 @@ func TestComponentLifecycle(t *testing.T) { tests := []struct { name string - createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + createFn func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) }{ { name: "metrics", - createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) }, }, @@ -70,19 +70,19 @@ func TestComponentLifecycle(t *testing.T) { for _, test := range tests { t.Run(test.name+"-shutdown", func(t *testing.T) { - c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + c, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() require.NoError(t, err) require.NoError(t, firstRcvr.Start(context.Background(), host)) require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondRcvr.Start(context.Background(), host)) require.NoError(t, secondRcvr.Shutdown(context.Background())) diff --git a/receiver/nvmlreceiver/factory_gpu_off.go b/receiver/nvmlreceiver/factory_gpu_off.go index 1a68d51b9..3735c0e26 100644 --- a/receiver/nvmlreceiver/factory_gpu_off.go +++ b/receiver/nvmlreceiver/factory_gpu_off.go @@ -29,7 +29,7 @@ import ( func createMetricsReceiver( _ context.Context, - _ receiver.CreateSettings, + _ receiver.Settings, _ component.Config, _ consumer.Metrics, ) (receiver.Metrics, error) { diff --git a/receiver/nvmlreceiver/factory_gpu_off_test.go b/receiver/nvmlreceiver/factory_gpu_off_test.go index 0baf6803e..7dd2b578b 100644 --- a/receiver/nvmlreceiver/factory_gpu_off_test.go +++ b/receiver/nvmlreceiver/factory_gpu_off_test.go @@ -34,7 +34,7 @@ func TestCreateMetricsReceiverWithGPUSupportOff(t *testing.T) { cfg := factory.CreateDefaultConfig() receiver, err := factory.CreateMetricsReceiver( context.Background(), - receivertest.NewNopCreateSettings(), + receivertest.NewNopSettings(), cfg, consumertest.NewNop()) diff --git a/receiver/nvmlreceiver/factory_gpu_on.go b/receiver/nvmlreceiver/factory_gpu_on.go index 0f0923da7..84cbe5bdf 100644 --- a/receiver/nvmlreceiver/factory_gpu_on.go +++ b/receiver/nvmlreceiver/factory_gpu_on.go @@ -31,7 +31,7 @@ import ( func createMetricsReceiver( _ context.Context, - params receiver.CreateSettings, + params receiver.Settings, rConf component.Config, consumer consumer.Metrics, ) (receiver.Metrics, error) { diff --git a/receiver/nvmlreceiver/factory_gpu_on_test.go b/receiver/nvmlreceiver/factory_gpu_on_test.go index aa32fd638..108075d14 100644 --- a/receiver/nvmlreceiver/factory_gpu_on_test.go +++ b/receiver/nvmlreceiver/factory_gpu_on_test.go @@ -33,7 +33,7 @@ func TestCreateMetricsReceiverGPUSupportOn(t *testing.T) { receiver, err := factory.CreateMetricsReceiver( context.Background(), - receivertest.NewNopCreateSettings(), + receivertest.NewNopSettings(), receiverConfig, consumertest.NewNop(), ) diff --git a/receiver/nvmlreceiver/internal/metadata/generated_metrics.go b/receiver/nvmlreceiver/internal/metadata/generated_metrics.go index ac9e4d057..b0b3f88fd 100644 --- a/receiver/nvmlreceiver/internal/metadata/generated_metrics.go +++ b/receiver/nvmlreceiver/internal/metadata/generated_metrics.go @@ -284,7 +284,7 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { } } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ config: mbc, startTime: pcommon.NewTimestampFromTime(time.Now()), diff --git a/receiver/nvmlreceiver/internal/metadata/generated_metrics_test.go b/receiver/nvmlreceiver/internal/metadata/generated_metrics_test.go index 5849ff10e..a4bb53668 100644 --- a/receiver/nvmlreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/nvmlreceiver/internal/metadata/generated_metrics_test.go @@ -48,7 +48,7 @@ func TestMetricsBuilder(t *testing.T) { start := pcommon.Timestamp(1_000_000_000) ts := pcommon.Timestamp(1_000_001_000) observedZapCore, observedLogs := observer.New(zap.WarnLevel) - settings := receivertest.NewNopCreateSettings() + settings := receivertest.NewNopSettings() settings.Logger = zap.New(observedZapCore) mb := NewMetricsBuilder(loadMetricsBuilderConfig(t, test.name), settings, WithStartTime(start)) diff --git a/receiver/nvmlreceiver/scraper.go b/receiver/nvmlreceiver/scraper.go index 31f7403ff..be20b02a6 100644 --- a/receiver/nvmlreceiver/scraper.go +++ b/receiver/nvmlreceiver/scraper.go @@ -32,12 +32,12 @@ import ( type nvmlScraper struct { config *Config - settings receiver.CreateSettings + settings receiver.Settings client *nvmlClient mb *metadata.MetricsBuilder } -func newNvmlScraper(config *Config, settings receiver.CreateSettings) *nvmlScraper { +func newNvmlScraper(config *Config, settings receiver.Settings) *nvmlScraper { return &nvmlScraper{config: config, settings: settings} } diff --git a/receiver/nvmlreceiver/scraper_gpu_test.go b/receiver/nvmlreceiver/scraper_gpu_test.go index 5faef49dd..9f4ab2207 100644 --- a/receiver/nvmlreceiver/scraper_gpu_test.go +++ b/receiver/nvmlreceiver/scraper_gpu_test.go @@ -36,7 +36,7 @@ import ( ) func TestScrapeWithGpuPresent(t *testing.T) { - scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.CreateSettings{}) + scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.Settings{}) require.NotNil(t, scraper) err := scraper.start(context.Background(), componenttest.NewNopHost()) @@ -54,7 +54,7 @@ func TestScrapeOnGpuUtilizationUnsupported(t *testing.T) { return nvml.VALUE_TYPE_SIGNED_LONG_LONG, nil, nvml.ERROR_NOT_SUPPORTED } - scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.CreateSettings{}) + scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.Settings{}) require.NotNil(t, scraper) err := scraper.start(context.Background(), componenttest.NewNopHost()) @@ -71,7 +71,7 @@ func TestScrapeOnGpuMemoryInfoUnsupported(t *testing.T) { return nvml.Memory{}, nvml.ERROR_NOT_SUPPORTED } - scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.CreateSettings{}) + scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.Settings{}) require.NotNil(t, scraper) err := scraper.start(context.Background(), componenttest.NewNopHost()) @@ -85,7 +85,7 @@ func TestScrapeWithGpuProcessAccounting(t *testing.T) { logger := zaptest.NewLogger(t) logger.Sugar().Warnf("This test requires superuser privileges.") - scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.CreateSettings{}) + scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.Settings{}) require.NotNil(t, scraper) err := scraper.start(context.Background(), componenttest.NewNopHost()) @@ -109,7 +109,7 @@ func TestScrapeWithGpuProcessAccountingError(t *testing.T) { return nil, nvml.ERROR_UNKNOWN } - scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.CreateSettings{}) + scraper := newNvmlScraper(createDefaultConfig().(*Config), receiver.Settings{}) require.NotNil(t, scraper) err := scraper.start(context.Background(), componenttest.NewNopHost()) @@ -133,7 +133,7 @@ func TestScrapeEmitsWarningsUptoThreshold(t *testing.T) { } warnings := 0 - var settings receiver.CreateSettings + var settings receiver.Settings settings.Logger = zaptest.NewLogger(t, zaptest.WrapOptions(zap.Hooks(func(e zapcore.Entry) error { if e.Level == zap.WarnLevel && strings.Contains(e.Message, "Unable to query") { warnings = warnings + 1 diff --git a/receiver/nvmlreceiver/scraper_test.go b/receiver/nvmlreceiver/scraper_test.go index 0cc334149..1fa7b858b 100644 --- a/receiver/nvmlreceiver/scraper_test.go +++ b/receiver/nvmlreceiver/scraper_test.go @@ -32,7 +32,7 @@ func TestScrapeOnLibraryNotFound(t *testing.T) { defer func() { nvmlInit = realNvmlInit }() nvmlInit = func() nvml.Return { panic("library not found") } - scraper := newNvmlScraper(createDefaultConfig().(*Config), receivertest.NewNopCreateSettings()) + scraper := newNvmlScraper(createDefaultConfig().(*Config), receivertest.NewNopSettings()) require.NotNil(t, scraper) err := scraper.start(context.Background(), componenttest.NewNopHost()) diff --git a/receiver/varnishreceiver/factory.go b/receiver/varnishreceiver/factory.go index 87d871d17..d33bbd7e7 100644 --- a/receiver/varnishreceiver/factory.go +++ b/receiver/varnishreceiver/factory.go @@ -44,7 +44,7 @@ func createDefaultConfig() component.Config { func createMetricsReceiver( _ context.Context, - params receiver.CreateSettings, + params receiver.Settings, rConf component.Config, consumer consumer.Metrics, ) (receiver.Metrics, error) { diff --git a/receiver/varnishreceiver/factory_test.go b/receiver/varnishreceiver/factory_test.go index cd3938dbc..e37b5401a 100644 --- a/receiver/varnishreceiver/factory_test.go +++ b/receiver/varnishreceiver/factory_test.go @@ -58,7 +58,7 @@ func TestCreateMetricsReceiver(t *testing.T) { _, err := createMetricsReceiver( context.Background(), - receivertest.NewNopCreateSettings(), + receivertest.NewNopSettings(), createDefaultConfig(), consumertest.NewNop(), ) diff --git a/receiver/varnishreceiver/generated_component_test.go b/receiver/varnishreceiver/generated_component_test.go index eafecc342..cf6225a81 100644 --- a/receiver/varnishreceiver/generated_component_test.go +++ b/receiver/varnishreceiver/generated_component_test.go @@ -28,12 +28,12 @@ func TestComponentLifecycle(t *testing.T) { tests := []struct { name string - createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) + createFn func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) }{ { name: "metrics", - createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) { + createFn: func(ctx context.Context, set receiver.Settings, cfg component.Config) (component.Component, error) { return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop()) }, }, @@ -48,19 +48,19 @@ func TestComponentLifecycle(t *testing.T) { for _, test := range tests { t.Run(test.name+"-shutdown", func(t *testing.T) { - c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + c, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) t.Run(test.name+"-lifecycle", func(t *testing.T) { - firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() require.NoError(t, err) require.NoError(t, firstRcvr.Start(context.Background(), host)) require.NoError(t, firstRcvr.Shutdown(context.Background())) - secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopSettings(), cfg) require.NoError(t, err) require.NoError(t, secondRcvr.Start(context.Background(), host)) require.NoError(t, secondRcvr.Shutdown(context.Background())) diff --git a/receiver/varnishreceiver/internal/metadata/generated_metrics.go b/receiver/varnishreceiver/internal/metadata/generated_metrics.go index 9db6d4cd9..2cc8a2560 100644 --- a/receiver/varnishreceiver/internal/metadata/generated_metrics.go +++ b/receiver/varnishreceiver/internal/metadata/generated_metrics.go @@ -780,7 +780,7 @@ func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { } } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSettings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ config: mbc, startTime: pcommon.NewTimestampFromTime(time.Now()), diff --git a/receiver/varnishreceiver/internal/metadata/generated_metrics_test.go b/receiver/varnishreceiver/internal/metadata/generated_metrics_test.go index 20fbf6a32..1befdc88c 100644 --- a/receiver/varnishreceiver/internal/metadata/generated_metrics_test.go +++ b/receiver/varnishreceiver/internal/metadata/generated_metrics_test.go @@ -57,7 +57,7 @@ func TestMetricsBuilder(t *testing.T) { start := pcommon.Timestamp(1_000_000_000) ts := pcommon.Timestamp(1_000_001_000) observedZapCore, observedLogs := observer.New(zap.WarnLevel) - settings := receivertest.NewNopCreateSettings() + settings := receivertest.NewNopSettings() settings.Logger = zap.New(observedZapCore) mb := NewMetricsBuilder(loadMetricsBuilderConfig(t, test.name), settings, WithStartTime(start)) diff --git a/receiver/varnishreceiver/scraper.go b/receiver/varnishreceiver/scraper.go index 2642a77ba..aa7654d50 100644 --- a/receiver/varnishreceiver/scraper.go +++ b/receiver/varnishreceiver/scraper.go @@ -37,7 +37,7 @@ type varnishScraper struct { cacheName string } -func newVarnishScraper(settings receiver.CreateSettings, config *Config) *varnishScraper { +func newVarnishScraper(settings receiver.Settings, config *Config) *varnishScraper { return &varnishScraper{ telemetrySettings: settings.TelemetrySettings, config: config, diff --git a/receiver/varnishreceiver/scraper_test.go b/receiver/varnishreceiver/scraper_test.go index b5c77c1f7..69dfa2b2c 100644 --- a/receiver/varnishreceiver/scraper_test.go +++ b/receiver/varnishreceiver/scraper_test.go @@ -41,7 +41,7 @@ func TestScrape(t *testing.T) { mockClient := new(mockClient) mockClient.On("GetStats").Return(getStats(t, "mock_response6_5.json")) - scraper := newVarnishScraper(receivertest.NewNopCreateSettings(), cfg) + scraper := newVarnishScraper(receivertest.NewNopSettings(), cfg) scraper.client = mockClient actualMetrics, err := scraper.scrape(context.Background()) require.NoError(t, err) @@ -54,7 +54,7 @@ func TestScrape(t *testing.T) { mockClient := new(mockClient) mockClient.On("GetStats").Return(getStats(t, "mock_response6_0.json")) - scraper := newVarnishScraper(receivertest.NewNopCreateSettings(), cfg) + scraper := newVarnishScraper(receivertest.NewNopSettings(), cfg) scraper.client = mockClient actualMetrics, err := scraper.scrape(context.Background()) require.NoError(t, err) @@ -65,7 +65,7 @@ func TestScrape(t *testing.T) { t.Run("scrape error", func(t *testing.T) { obs, logs := observer.New(zap.ErrorLevel) - settings := receivertest.NewNopCreateSettings() + settings := receivertest.NewNopSettings() settings.TelemetrySettings.Logger = zap.New(obs) mockClient := new(mockClient) @@ -231,7 +231,7 @@ func TestStart(t *testing.T) { f := NewFactory() cfg := f.CreateDefaultConfig().(*Config) - scraper := newVarnishScraper(receivertest.NewNopCreateSettings(), cfg) + scraper := newVarnishScraper(receivertest.NewNopSettings(), cfg) err = scraper.start(context.Background(), componenttest.NewNopHost()) require.NoError(t, err) require.EqualValues(t, hostname, scraper.cacheName) @@ -240,7 +240,7 @@ func TestStart(t *testing.T) { f := NewFactory() cfg := f.CreateDefaultConfig().(*Config) cfg.CacheDir = "/path/cache_name" - scraper := newVarnishScraper(receivertest.NewNopCreateSettings(), cfg) + scraper := newVarnishScraper(receivertest.NewNopSettings(), cfg) err := scraper.start(context.Background(), componenttest.NewNopHost()) require.NoError(t, err) require.EqualValues(t, "cache_name", scraper.cacheName) @@ -251,7 +251,7 @@ func TestSetDefaultCacheName(t *testing.T) { t.Run("missing cache dir", func(t *testing.T) { f := NewFactory() cfg := f.CreateDefaultConfig().(*Config) - scraper := newVarnishScraper(receivertest.NewNopCreateSettings(), cfg) + scraper := newVarnishScraper(receivertest.NewNopSettings(), cfg) hostname, err := os.Hostname() require.NoError(t, err) @@ -265,7 +265,7 @@ func TestSetDefaultCacheName(t *testing.T) { f := NewFactory() cfg := f.CreateDefaultConfig().(*Config) cfg.CacheDir = "/path/cache_name" - scraper := newVarnishScraper(receivertest.NewNopCreateSettings(), cfg) + scraper := newVarnishScraper(receivertest.NewNopSettings(), cfg) err := scraper.setCacheName() require.NoError(t, err)