Skip to content

Commit

Permalink
signozkafkareceiver: add logs for failed exports (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhawal1248 authored Dec 27, 2023
1 parent 57c8024 commit c558765
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions receiver/signozkafkareceiver/kafka_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ func (c *tracesConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSe
err = c.nextConsumer.ConsumeTraces(session.Context(), traces)
c.obsrecv.EndTracesOp(ctx, c.unmarshaler.Encoding(), spanCount, err)
if err != nil {
c.logger.Error("kafka receiver: failed to export traces", zap.Error(err), zap.Int32("partition", claim.Partition()), zap.String("topic", claim.Topic()))
if c.messageMarking.After && c.messageMarking.OnError {
session.MarkMessage(message, "")
}
Expand Down Expand Up @@ -572,6 +573,7 @@ func (c *metricsConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupS
err = c.nextConsumer.ConsumeMetrics(session.Context(), metrics)
c.obsrecv.EndMetricsOp(ctx, c.unmarshaler.Encoding(), dataPointCount, err)
if err != nil {
c.logger.Error("kafka receiver: failed to export metrics", zap.Error(err), zap.Int32("partition", claim.Partition()), zap.String("topic", claim.Topic()))
if c.messageMarking.After && c.messageMarking.OnError {
session.MarkMessage(message, "")
}
Expand Down Expand Up @@ -652,6 +654,7 @@ func (c *logsConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSess
// TODO
c.obsrecv.EndLogsOp(ctx, c.unmarshaler.Encoding(), logs.LogRecordCount(), err)
if err != nil {
c.logger.Error("kafka receiver: failed to export logs", zap.Error(err), zap.Int32("partition", claim.Partition()), zap.String("topic", claim.Topic()))
if c.messageMarking.After && c.messageMarking.OnError {
session.MarkMessage(message, "")
}
Expand Down

0 comments on commit c558765

Please sign in to comment.