kaizen-solutions / trace4cats-zio-extras

Distributed tracing for ZIO. A set of enhancements to users who want to use ZIO with trace4cats
MIT License
9 stars 2 forks source link

[fs2-kafka; zio-kafka] Using `KafkaConsumerTracer.traceConsumerStream` causes some commits to fail #43

Open soujiro32167 opened 2 months ago

soujiro32167 commented 2 months ago

Repro:

kafkaConsumer
      .subscribeTo("topic") *>
      kafkaConsumer.partitionedStream
        .map(s =>
          KafkaConsumerTracer
            .traceConsumerStream(ztracer, s)
            .evalMapChunkWithTracer(ztracer, "handler") {
              case CommittableConsumerRecord(_, offset) =>
                ZIO.succeed(offset)
            }
            .endTracingEachElement
        )
        .parJoinUnbounded
        .through(commitBatchWithin(500, 5.seconds))
        .compile
        .drain

Commits don't get recorded

calvinlfer commented 2 months ago

Hey @soujiro32167 Is it that commits fail to get committed by Kafka or is it that commits don’t show up in the traces/spans?