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

Replace deprecated use of host.ReportFatalError #30693

Closed
wants to merge 2 commits into from

Conversation

execis
Copy link

@execis execis commented Jan 20, 2024

Description:
This update refactors the Start method of the sfxReceiver to remove the deprecated host.ReportFatalError call. The code now uses the new settings.TelemetrySettings.ReportStatus method with component.NewFatalErrorEvent(err) to report startup errors.

Link to tracking Issue:
#30598

Testing:
The updated code has been tested to handle error scenarios during the startup of the sfxReceiver, and it now properly reports errors using the new telemetry settings.

Documentation:
No changes to external documentation were needed as the change is internal to the sfxReceiver's implementation and does not affect the receiver's interface or configuration.

@execis execis requested a review from dmitryax as a code owner January 20, 2024 04:14
@execis execis requested a review from a team January 20, 2024 04:14
Copy link

linux-foundation-easycla bot commented Jan 20, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

}
}()

return nil
}


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

@@ -115,7 +115,7 @@ func (r *sfxReceiver) RegisterLogsConsumer(lc consumer.Logs) {
// Start tells the receiver to start its processing.
// By convention the consumer of the received data is set when the receiver
// instance is created.
func (r *sfxReceiver) Start(_ context.Context, host component.Host) error {
func (r *sfxReceiver) Start(ctx context.Context, host component.Host) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is not necessary - try make lint to see if this passes.

@dev-jesse
Copy link

dev-jesse commented Jan 31, 2024

Looks like your changelog check didn't pass. To fix this, you can refer to this portion of the CONTRIBUTING.md file:

  1. Create an entry file using make chlog-new. This generates a file based on your current branch (e.g. ./.chloggen/my-branch.yaml)
  2. Fill in all fields in the new file
  3. Run make chlog-validate to ensure the new file is valid
  4. Commit and push the file

Or

Alternately, copy ./.chloggen/TEMPLATE.yaml, or just create your file from scratch.

Copy link
Author

@execis execis left a comment

Choose a reason for hiding this comment

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

The parameter has been renamed and make lint now passes all the tests.

ddr.params.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(err))
}
}()
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert whitespace changes

@@ -47,35 +47,35 @@ func newDataDogReceiver(config *Config, nextConsumer consumer.Traces, params rec
}

func (ddr *datadogReceiver) Start(_ context.Context, host component.Host) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should not be part of this PR

component: signalfxreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fixed an issue in the SignalFx receiver where the context parameter was not utilized properly.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's not correct, the changes to signalfxreceiver do not include changing the context parameter.

Given that this change has no impact on user or API changelog, please delete this changelog entry and instead prefix the commit message with [chore] or add the label Skip Changelog to the PR.

@@ -105,7 +105,7 @@ var _ http.Handler = (*firehoseReceiver)(nil)

// Start spins up the receiver's HTTP server and makes the receiver start
// its processing.
func (fmr *firehoseReceiver) Start(_ context.Context, host component.Host) error {
func (fmr *firehoseReceiver) Start(ctx context.Context, host component.Host) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this file changed? I thought the PR was only touching signalfxreceiver.

@atoulme
Copy link
Contributor

atoulme commented Feb 8, 2024

Closing - let's open separate PRs for each component.

@atoulme atoulme closed this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants