Skip to content

Commit

Permalink
Fix data race between kafkareceiver and batchprocessor (open-telemetr…
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjm authored Apr 19, 2021
1 parent 93821c9 commit ec395ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kafka_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ func (c *consumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession,
return err
}

spanCount := traces.SpanCount()
err = c.nextConsumer.ConsumeTraces(session.Context(), traces)
obsreport.EndTraceDataReceiveOp(ctx, c.unmarshaller.Encoding(), traces.SpanCount(), err)
obsreport.EndTraceDataReceiveOp(ctx, c.unmarshaller.Encoding(), spanCount, err)
if err != nil {
return err
}
Expand Down

0 comments on commit ec395ec

Please sign in to comment.