Skip to content

Commit

Permalink
[chore] Replace usage of deprecated GetExportersWithSignal with GetEx…
Browse files Browse the repository at this point in the history
…porters (#35775)

This unblocks
open-telemetry/opentelemetry-collector#11444

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Oct 14, 2024
1 parent d20c3f8 commit 2295a09
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion processor/routingprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions processor/routingprocessor/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ 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 {
ge, ok := host.(getExporters)
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
}
Expand Down
2 changes: 1 addition & 1 deletion processor/routingprocessor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion processor/routingprocessor/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion receiver/k8sclusterreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
4 changes: 2 additions & 2 deletions receiver/k8sclusterreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion receiver/k8sclusterreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 2295a09

Please sign in to comment.