From 2295a097522e0326c5e31128c4361a6f3e63c058 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 14 Oct 2024 15:36:44 -0700 Subject: [PATCH] [chore] Replace usage of deprecated GetExportersWithSignal with GetExporters (#35775) This unblocks https://github.com/open-telemetry/opentelemetry-collector/pull/11444 Signed-off-by: Bogdan Drutu --- processor/routingprocessor/factory_test.go | 2 +- processor/routingprocessor/logs.go | 4 ++-- processor/routingprocessor/metrics.go | 2 +- processor/routingprocessor/traces.go | 2 +- receiver/k8sclusterreceiver/factory_test.go | 2 +- receiver/k8sclusterreceiver/receiver.go | 4 ++-- receiver/k8sclusterreceiver/receiver_test.go | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/processor/routingprocessor/factory_test.go b/processor/routingprocessor/factory_test.go index 9500e97b4bdf..32d274de2666 100644 --- a/processor/routingprocessor/factory_test.go +++ b/processor/routingprocessor/factory_test.go @@ -220,7 +220,7 @@ func newMockHost(exps map[pipeline.Signal]map[component.ID]component.Component) } } -func (m *mockHost) GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component { +func (m *mockHost) GetExporters() map[pipeline.Signal]map[component.ID]component.Component { return m.exps } diff --git a/processor/routingprocessor/logs.go b/processor/routingprocessor/logs.go index 65bdb4f168f8..2a613e1cfdaa 100644 --- a/processor/routingprocessor/logs.go +++ b/processor/routingprocessor/logs.go @@ -63,7 +63,7 @@ func newLogProcessor(settings component.TelemetrySettings, config component.Conf } type getExporters interface { - GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component + GetExporters() map[pipeline.Signal]map[component.ID]component.Component } func (p *logProcessor) Start(_ context.Context, host component.Host) error { @@ -71,7 +71,7 @@ func (p *logProcessor) Start(_ context.Context, host component.Host) error { if !ok { return fmt.Errorf("unable to get exporters") } - err := p.router.registerExporters(ge.GetExportersWithSignal()[pipeline.SignalLogs]) + err := p.router.registerExporters(ge.GetExporters()[pipeline.SignalLogs]) if err != nil { return err } diff --git a/processor/routingprocessor/metrics.go b/processor/routingprocessor/metrics.go index c48d96ab958e..a82203205ac9 100644 --- a/processor/routingprocessor/metrics.go +++ b/processor/routingprocessor/metrics.go @@ -67,7 +67,7 @@ func (p *metricsProcessor) Start(_ context.Context, host component.Host) error { if !ok { return fmt.Errorf("unable to get exporters") } - err := p.router.registerExporters(ge.GetExportersWithSignal()[pipeline.SignalMetrics]) + err := p.router.registerExporters(ge.GetExporters()[pipeline.SignalMetrics]) if err != nil { return err } diff --git a/processor/routingprocessor/traces.go b/processor/routingprocessor/traces.go index 84fcface4327..7c00e0cf65f3 100644 --- a/processor/routingprocessor/traces.go +++ b/processor/routingprocessor/traces.go @@ -68,7 +68,7 @@ func (p *tracesProcessor) Start(_ context.Context, host component.Host) error { if !ok { return fmt.Errorf("unable to get exporters") } - err := p.router.registerExporters(ge.GetExportersWithSignal()[pipeline.SignalTraces]) + err := p.router.registerExporters(ge.GetExporters()[pipeline.SignalTraces]) if err != nil { return err } diff --git a/receiver/k8sclusterreceiver/factory_test.go b/receiver/k8sclusterreceiver/factory_test.go index 5243efb3ed6b..f78647de1be3 100644 --- a/receiver/k8sclusterreceiver/factory_test.go +++ b/receiver/k8sclusterreceiver/factory_test.go @@ -108,7 +108,7 @@ func newNopHostWithExporters() component.Host { return &nopHostWithExporters{Host: newNopHost()} } -func (n *nopHostWithExporters) GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component { +func (n *nopHostWithExporters) GetExporters() map[pipeline.Signal]map[component.ID]component.Component { return map[pipeline.Signal]map[component.ID]component.Component{ pipeline.SignalMetrics: { component.MustNewIDWithName("nop", "withoutmetadata"): MockExporter{}, diff --git a/receiver/k8sclusterreceiver/receiver.go b/receiver/k8sclusterreceiver/receiver.go index 6849395ef64e..ae9c5f75ca8b 100644 --- a/receiver/k8sclusterreceiver/receiver.go +++ b/receiver/k8sclusterreceiver/receiver.go @@ -40,7 +40,7 @@ type kubernetesReceiver struct { } type getExporters interface { - GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component + GetExporters() map[pipeline.Signal]map[component.ID]component.Component } func (kr *kubernetesReceiver) Start(ctx context.Context, host component.Host) error { @@ -54,7 +54,7 @@ func (kr *kubernetesReceiver) Start(ctx context.Context, host component.Host) er if !ok { return fmt.Errorf("unable to get exporters") } - exporters := ge.GetExportersWithSignal() + exporters := ge.GetExporters() if err := kr.resourceWatcher.setupMetadataExporters( exporters[pipeline.SignalMetrics], kr.config.MetadataExporters); err != nil { diff --git a/receiver/k8sclusterreceiver/receiver_test.go b/receiver/k8sclusterreceiver/receiver_test.go index 406f9107701b..533a625ea713 100644 --- a/receiver/k8sclusterreceiver/receiver_test.go +++ b/receiver/k8sclusterreceiver/receiver_test.go @@ -33,7 +33,7 @@ type nopHost struct { component.Host } -func (nh *nopHost) GetExportersWithSignal() map[pipeline.Signal]map[component.ID]component.Component { +func (nh *nopHost) GetExporters() map[pipeline.Signal]map[component.ID]component.Component { return nil }