Skip to content

Restore the consumer.group span attribute - #298

Merged
alejandrohdezma merged 1 commit into
mainfrom
feat/consumer-group-attribute
Sep 29, 2026
Merged

alejandrohdezma merged 1 commit into
mainfrom
feat/consumer-group-attribute

Conversation

@alejandrohdezma

Copy link
Copy Markdown
Member

fs2-kafka 4 removed CommittableOffset#consumerGroupId, so #293 dropped the consumer.group attribute from kafka.receive spans.

This brings it back through KafkaCommitter#metadata. Since that calls the blocking groupMetadata() on the consumer, the group id is fetched once per committer and cached for the rest of the stream. A failing fetch (no group.id configured) falls back to an empty string, matching the pre-4.0 behaviour.

inject keeps its Functor[G] bound, the caching runs in F. injectK is unchanged.

Includes a test asserting the attribute is set on every record and the metadata is fetched a single time.

fs2-kafka 4 removed `CommittableOffset#consumerGroupId`, so the migration
in #293 dropped the `consumer.group` attribute from `kafka.receive` spans.
The group id is still reachable through `KafkaCommitter#metadata`, which
calls the blocking `groupMetadata()` on the underlying consumer, so it is
fetched once per committer and cached for the rest of the stream. A
failing fetch (no `group.id` configured) falls back to an empty string,
as before.
@github-actions github-actions Bot added 🚀 feature New feature or improvement ⚖️ S Size of PR between 50 and 100 lines labels Sep 29, 2026
@alejandrohdezma
alejandrohdezma merged commit 756ad74 into main Sep 29, 2026
5 checks passed
@alejandrohdezma
alejandrohdezma deleted the feat/consumer-group-attribute branch September 29, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚖️ S Size of PR between 50 and 100 lines 🚀 feature New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant