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]ReportComponentStatus -> ReportStatus #30386

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion extension/healthcheckextension/healthcheckextension.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (hc *healthCheckExtension) Start(_ context.Context, host component.Host) er

// The listener ownership goes to the server.
if err = hc.server.Serve(ln); !errors.Is(err, http.ErrServerClosed) && err != nil {
_ = hc.settings.ReportComponentStatus(component.NewFatalErrorEvent(err))
hc.settings.ReportStatus(component.NewFatalErrorEvent(err))
}
}()
} else {
Expand Down
2 changes: 1 addition & 1 deletion extension/jaegerremotesampling/internal/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (h *SamplingHTTPServer) Start(_ context.Context, host component.Host) error
defer h.shutdownWG.Done()

if err := h.srv.Serve(hln); err != nil && !errors.Is(err, http.ErrServerClosed) {
_ = h.telemetry.ReportComponentStatus(component.NewFatalErrorEvent(err))
h.telemetry.ReportStatus(component.NewFatalErrorEvent(err))
}
}()

Expand Down
2 changes: 1 addition & 1 deletion extension/observer/ecsobserver/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (e *ecsObserver) Start(_ context.Context, _ component.Host) error {
if err := e.sd.runAndWriteFile(ctx); err != nil {
e.telemetrySettings.Logger.Error("ECSDiscovery stopped by error", zap.Error(err))
// Stop the collector
_ = e.telemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err))
e.telemetrySettings.ReportStatus(component.NewFatalErrorEvent(err))
}
}()
return nil
Expand Down
3 changes: 1 addition & 2 deletions extension/observer/ecsobserver/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ func TestExtensionStartStop(t *testing.T) {
sdCfg.ResultFile = "testdata/ut_ext_critical_error.actual.yaml"
cs := extensiontest.NewNopCreateSettings()
statusEventChan := make(chan *component.StatusEvent)
cs.TelemetrySettings.ReportComponentStatus = func(e *component.StatusEvent) error {
cs.TelemetrySettings.ReportStatus = func(e *component.StatusEvent) {
statusEventChan <- e
return nil
}
ext, err := createExtensionWithFetcher(cs, sdCfg, f)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion extension/remotetapextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *remoteObserverExtension) Start(_ context.Context, host component.Host)
go func() {
err := s.server.ListenAndServe()
if err != nil && !errors.Is(err, http.ErrServerClosed) {
_ = s.settings.TelemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err))
s.settings.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(err))
}
}()
return nil
Expand Down
4 changes: 2 additions & 2 deletions receiver/cloudflarereceiver/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (l *logsReceiver) startListening(ctx context.Context, _ component.Host) err

if !errors.Is(err, http.ErrServerClosed) {
l.logger.Error("ServeTLS failed", zap.Error(err))
_ = l.telemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err))
l.telemetrySettings.ReportStatus(component.NewFatalErrorEvent(err))
}

} else {
Expand All @@ -123,7 +123,7 @@ func (l *logsReceiver) startListening(ctx context.Context, _ component.Host) err

if !errors.Is(err, http.ErrServerClosed) {
l.logger.Error("Serve failed", zap.Error(err))
_ = l.telemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err))
l.telemetrySettings.ReportStatus(component.NewFatalErrorEvent(err))
}

}
Expand Down
2 changes: 1 addition & 1 deletion receiver/collectdreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (cdr *collectdReceiver) Start(_ context.Context, host component.Host) error
}
go func() {
if err := cdr.server.Serve(l); !errors.Is(err, http.ErrServerClosed) && err != nil {
_ = cdr.createSettings.TelemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err))
cdr.createSettings.TelemetrySettings.ReportStatus(component.NewFatalErrorEvent(err))
}
}()
return nil
Expand Down