-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: bug_fix | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
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. | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [30598] | ||
|
||
# (Optional) One or more lines of additional information to render under the primary note. | ||
# These lines will be padded with 2 spaces and then inserted directly into the document. | ||
# Use pipe (|) for multiline entries. | ||
subtext: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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 { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||
if host == nil { | ||||
return errMissingHost | ||||
} | ||||
|
@@ -126,13 +126,14 @@ func (fmr *firehoseReceiver) Start(_ context.Context, host component.Host) error | |||
defer fmr.shutdownWG.Done() | ||||
|
||||
if errHTTP := fmr.server.Serve(listener); errHTTP != nil && !errors.Is(errHTTP, http.ErrServerClosed) { | ||||
host.ReportFatalError(errHTTP) | ||||
fmr.settings.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(errHTTP)) | ||||
} | ||||
}() | ||||
|
||||
return nil | ||||
} | ||||
|
||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
// Shutdown tells the receiver that should stop reception, | ||||
// giving it a chance to perform any necessary clean-up and | ||||
// shutting down its HTTP server. | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,35 +47,35 @@ func newDataDogReceiver(config *Config, nextConsumer consumer.Traces, params rec | |
} | ||
|
||
func (ddr *datadogReceiver) Start(_ context.Context, host component.Host) error { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should not be part of this PR |
||
ddmux := http.NewServeMux() | ||
ddmux.HandleFunc("/v0.3/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/v0.4/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/v0.5/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/v0.7/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/api/v0.2/traces", ddr.handleTraces) | ||
|
||
var err error | ||
ddr.server, err = ddr.config.HTTPServerSettings.ToServer( | ||
host, | ||
ddr.params.TelemetrySettings, | ||
ddmux, | ||
) | ||
if err != nil { | ||
return fmt.Errorf("failed to create server definition: %w", err) | ||
} | ||
hln, err := ddr.config.HTTPServerSettings.ToListener() | ||
if err != nil { | ||
return fmt.Errorf("failed to create datadog listener: %w", err) | ||
} | ||
|
||
ddr.address = hln.Addr().String() | ||
|
||
go func() { | ||
if err := ddr.server.Serve(hln); err != nil && !errors.Is(err, http.ErrServerClosed) { | ||
host.ReportFatalError(fmt.Errorf("error starting datadog receiver: %w", err)) | ||
} | ||
}() | ||
return nil | ||
ddmux := http.NewServeMux() | ||
ddmux.HandleFunc("/v0.3/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/v0.4/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/v0.5/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/v0.7/traces", ddr.handleTraces) | ||
ddmux.HandleFunc("/api/v0.2/traces", ddr.handleTraces) | ||
|
||
var err error | ||
ddr.server, err = ddr.config.HTTPServerSettings.ToServer( | ||
host, | ||
ddr.params.TelemetrySettings, | ||
ddmux, | ||
) | ||
if err != nil { | ||
return fmt.Errorf("failed to create server definition: %w", err) | ||
} | ||
hln, err := ddr.config.HTTPServerSettings.ToListener() | ||
if err != nil { | ||
return fmt.Errorf("failed to create datadog listener: %w", err) | ||
} | ||
|
||
ddr.address = hln.Addr().String() | ||
|
||
go func() { | ||
if err := ddr.server.Serve(hln); err != nil && !errors.Is(err, http.ErrServerClosed) { | ||
ddr.params.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(err)) | ||
} | ||
}() | ||
return nil | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert whitespace changes |
||
} | ||
|
||
func (ddr *datadogReceiver) Shutdown(ctx context.Context) (err error) { | ||
|
There was a problem hiding this comment.
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 labelSkip Changelog
to the PR.