Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] start and stop otlp exporter once #32809

Merged
merged 2 commits into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions testbed/testbed/receivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ func (bor *BaseOTLPDataReceiver) Start(tc consumer.Traces, mc consumer.Metrics,
return err
}

if err = bor.traceReceiver.Start(context.Background(), componenttest.NewNopHost()); err != nil {
return err
}
if err = bor.metricsReceiver.Start(context.Background(), componenttest.NewNopHost()); err != nil {
return err
}
// we reuse the receiver across signals. Starting the log receiver starts the metrics and traces receiver.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing, do we need the three factory calls above then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need them to set the logs, metrics and traces consumer.

return bor.logReceiver.Start(context.Background(), componenttest.NewNopHost())
}

Expand All @@ -104,12 +99,7 @@ func (bor *BaseOTLPDataReceiver) WithQueue(sendingQueue string) *BaseOTLPDataRec
}

func (bor *BaseOTLPDataReceiver) Stop() error {
if err := bor.traceReceiver.Shutdown(context.Background()); err != nil {
return err
}
if err := bor.metricsReceiver.Shutdown(context.Background()); err != nil {
return err
}
// we reuse the receiver across signals. Shutting down the log receiver shuts down the metrics and traces receiver.
return bor.logReceiver.Shutdown(context.Background())
}

Expand Down
Loading