@opentelemetry/instrumentation-kafkajs does not instrument sendBatch
or send
methods if they are being called during KafkaJs transaction (e.g. producer.transaction().sendBatch()
)
#2741
Labels
bug
Something isn't working
pkg:instrumentation-kafkajs
priority:p2
Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
What version of OpenTelemetry are you using?
What version of Node are you using?
v22.13.1
What did you do?
I have code that sends batch messages during the kafkajs' transaction, e.g:
What did you expect to see?
I expected to see span are emitted for each
sendBatch
call that happens during kafkajs' transaction and each message in kafka to havetraceparent
header if it is possibleWhat did you see instead?
I didn't see any spans were emitted or
traceparent
header was setAdditional context
I can confirm that if I run it without transaction I see spans are emitted and
traceparent
header is setMy best guess is
producer.transaction().sendBatch()
is not wrapped currently, only send methods of producer are wrapped (e.gproducer.sendBatch()
)https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/instrumentation-kafkajs/src/instrumentation.ts#L133
https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/instrumentation-kafkajs/src/instrumentation.ts#L142
The text was updated successfully, but these errors were encountered: