Skip to content

Commit

Permalink
fix collector panic due to sarama sdk
Browse files Browse the repository at this point in the history
Signed-off-by: luhualin <[email protected]>
  • Loading branch information
Betula-L committed Nov 26, 2020
1 parent b8ccf73 commit 594f7f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/storage/kafka/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ func NewSpanWriter(
}()
go func() {
for e := range producer.Errors() {
logger.Error(e.Err.Error())
writeMetrics.SpansWrittenFailure.Inc(1)
if e != nil && e.Err != nil {
logger.Error(e.Err.Error())
writeMetrics.SpansWrittenFailure.Inc(1)
}
}
}()

Expand Down

0 comments on commit 594f7f6

Please sign in to comment.