Skip to content

Commit

Permalink
[chore] jaeger receiver ReportFatalError -> ReportStatus (open-teleme…
Browse files Browse the repository at this point in the history
…try#30609)

Remove use of deprecated host.ReportFatalError

Linked to
open-telemetry#30501
Fixes open-telemetry#30591

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten authored and cparkins committed Feb 1, 2024
1 parent 2938f8a commit 9637a30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion receiver/jaegerreceiver/jaeger_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestJaegerAgentUDP_ThriftBinary_PortInUse(t *testing.T) {
jr, err := newJaegerReceiver(jaegerAgent, config, nil, set)
require.NoError(t, err)

assert.NoError(t, jr.startAgent(componenttest.NewNopHost()), "Start failed")
assert.NoError(t, jr.startAgent(), "Start failed")
t.Cleanup(func() { require.NoError(t, jr.Shutdown(context.Background())) })

l, err := net.Listen("udp", addr)
Expand Down
10 changes: 5 additions & 5 deletions receiver/jaegerreceiver/trace_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func newJaegerReceiver(
}

func (jr *jReceiver) Start(_ context.Context, host component.Host) error {
if err := jr.startAgent(host); err != nil {
if err := jr.startAgent(); err != nil {
return err
}

Expand Down Expand Up @@ -222,7 +222,7 @@ func (jr *jReceiver) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest)
return &api_v2.PostSpansResponse{}, nil
}

func (jr *jReceiver) startAgent(host component.Host) error {
func (jr *jReceiver) startAgent() error {
if jr.config == nil {
return nil
}
Expand Down Expand Up @@ -283,7 +283,7 @@ func (jr *jReceiver) startAgent(host component.Host) error {
go func() {
defer jr.goroutines.Done()
if err := jr.agentServer.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) && err != nil {
host.ReportFatalError(fmt.Errorf("jaeger agent server error: %w", err))
jr.settings.ReportStatus(component.NewFatalErrorEvent(fmt.Errorf("jaeger agent server error: %w", err)))
}
}()
}
Expand Down Expand Up @@ -391,7 +391,7 @@ func (jr *jReceiver) startCollector(host component.Host) error {
go func() {
defer jr.goroutines.Done()
if errHTTP := jr.collectorServer.Serve(cln); !errors.Is(errHTTP, http.ErrServerClosed) && errHTTP != nil {
host.ReportFatalError(errHTTP)
jr.settings.ReportStatus(component.NewFatalErrorEvent(errHTTP))
}
}()
}
Expand All @@ -414,7 +414,7 @@ func (jr *jReceiver) startCollector(host component.Host) error {
go func() {
defer jr.goroutines.Done()
if errGrpc := jr.grpc.Serve(ln); !errors.Is(errGrpc, grpc.ErrServerStopped) && errGrpc != nil {
host.ReportFatalError(errGrpc)
jr.settings.ReportStatus(component.NewFatalErrorEvent(errGrpc))
}
}()
}
Expand Down

0 comments on commit 9637a30

Please sign in to comment.