[kafka_consumer] Emit consumer_membership DSM events#24601
[kafka_consumer] Emit consumer_membership DSM events#24601piochelepiotr wants to merge 5 commits into
Conversation
Emit a consumer_membership data-streams-message per consumer group with the kafka cluster id, group id and current member ids, so DSM can reconcile group membership with infra tags. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 7fac138 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31861a8462
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| aggregator.assert_metric('kafka.consumer_group.membership_changes', count=0) | ||
|
|
||
|
|
||
| def _consumer_membership_events(check): |
There was a problem hiding this comment.
Rename the test helper without a leading underscore
In this repo, AGENTS.md explicitly says that module-level helpers in test files should not use a leading underscore unless they are instance methods or reusable-library helpers with non-obvious side effects. This newly added test helper is a free function in a test module, so keeping the _consumer_membership_events name violates the repository convention; rename it without the privacy prefix and update the call site.
Useful? React with 👍 / 👎.
The describe_consumer_groups response already carries client_id and host per member, so include them (as a 'members' detail list) alongside member_ids. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… comments Rename _consumer_membership_events -> consumer_membership_events per AGENTS.md (module-level test helpers don't take a leading underscore). Remove a couple of now-redundant explanatory comments. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ents Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Validation ReportAll 21 validations passed. Show details
|
What
The
kafka_consumerintegration now emits aconsumer_membershipdata-streams-messageper consumer group, containingkafka_cluster_id,group_id, and the sorted list ofmember_ids. Emitted from_collect_consumer_group_metadatawhere the member list is already gathered.Why
DSM uses this to reconcile consumer-group membership: drop departed members and seed tagless rows for members the tracer hasn't reported, while tracer-sourced infra tags win.
Part of a cross-repo change
Feeds the same
dsm-kafka-configspipeline as the dd-trace-java tracer: → dsm-kafka-configs-writer → orgstoreconsumer_group_members→ dsm-api.Tests
ddev test kafka_consumer—tests/test_cluster_metadata.pyall pass (54), including newtest_consumer_membership_event_emitted.🤖 Generated with Claude Code