Skip to content

Commit

Permalink
Do not fatal for ordinary consume errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacd committed Nov 9, 2023
1 parent 149a2bd commit 514be8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions generatorreceiver/generator_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ func (g generatorReceiver) Start(ctx context.Context, host component.Host) error
case <-traceTicker.C:
if rootRoute.ShouldGenerate() {
traces := traceGen.Generate(time.Now().UnixNano())
_ = g.traceConsumer.ConsumeTraces(context.Background(), *traces)
err := g.traceConsumer.ConsumeTraces(context.Background(), *traces)
if err != nil {
g.logger.Error("consume error", zap.Error(err))
}

}
}
}
Expand All @@ -157,7 +161,7 @@ func (g *generatorReceiver) startMetricGenerator(ctx context.Context, host compo
if metrics, report := metricGen.Generate(&m, serviceName); report {
err := g.metricConsumer.ConsumeMetrics(ctx, metrics)
if err != nil {
host.ReportFatalError(err)
g.logger.Error("consume error", zap.Error(err))
}
}
}
Expand Down

0 comments on commit 514be8a

Please sign in to comment.