Repository navigation
feat(instrumentation-kafkajs): record messaging.consumer.group.name on consumer spans and metrics - #3952
Open
leo-fresha wants to merge 1 commit into
Open
feat(instrumentation-kafkajs): record messaging.consumer.group.name on consumer spans and metrics#3952leo-fresha wants to merge 1 commit into
leo-fresha wants to merge 1 commit into
Conversation
|
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-js-contrib. Important reminders:
|
Pull request dashboard statusWaiting on the author · refreshed 2026-12-01 14:58 UTC Investigate required status check failures. Status above doesn't look right?
|
…n consumer spans and metrics The Kafka semantic conventions make messaging.consumer.group.name conditionally required on consumer spans and on the process duration and consumed messages metrics. The consumer patch now reads groupId from the config passed to kafka.consumer() and records it on the spans and metrics of eachMessage and eachBatch. Assisted-by: Claude Opus 5.5
leo-fresha
force-pushed
the
feat/kafkajs-consumer-group
branch
from
December 1, 2026 15:14
a7e1f25 to
08f372a
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
The Kafka semantic conventions make
messaging.consumer.group.nameconditionally required on consumer spans and on themessaging.process.durationandmessaging.client.consumed.messagesmetrics, whenever there is a consumer group. The instrumentation doesn't record it, so a span or metric can't be attributed to the group that consumed the message, and groups reading the same topic can't be told apart.Short description of the changes
groupIdfrom the config passed tokafka.consumer()and passes it to theeachMessageandeachBatchpatches, in the same way the client is passed formessaging.kafka.cluster.id(feat(instrumentation-kafkajs): add messaging.kafka.cluster.id span attribute #3577).processspans, theeachBatchpollspan, and the two consumer metrics record it asmessaging.consumer.group.name.This change was written with the help of Claude Opus 5.5 and reviewed by me before opening.