Skip to content

KAFKA-19070:: Adding task number to user provided client id to ensure each consumer has a unique client ID to avoid metric registration conflicts. #19341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

kumarpritam863
Copy link
Contributor

What
This PR updates the behavior of client.id assignment when a user provides a custom value via override configs in Kafka Connect.

Why
Currently, if a user overrides the client.id, all tasks or consumers inherit the same client ID. While this doesn't cause an immediate failure in Kafka, it leads to the following issues:

  • Metrics and logs are merged or overwritten, making observability inaccurate.

  • Quotas and throttling may be applied incorrectly.

  • Debugging becomes harder due to lack of per-task identity.

According to Kafka core behavior, client.id should be unique per client instance for proper tracking and diagnostics.

How
This PR appends the task number to the user-provided client.id to ensure uniqueness across tasks.

For example:

  • User provides: client.id=my-custom-client

  • Final client.id used by task 2: my-custom-client-2

This approach:

  • Respects the user’s original intent in naming

  • Guarantees unique client.id values per task

  • Improves metrics, logging, and debugging consistency

…each consumer has a unique client ID to avoid metric registration conflicts.
@github-actions github-actions bot added triage PRs from the community connect small Small PRs labels Apr 1, 2025
@kumarpritam863
Copy link
Contributor Author

@C0urante can you please review this.

@kumarpritam863
Copy link
Contributor Author

@dajac can you please review this.

@kumarpritam863
Copy link
Contributor Author

Hi @mimaison can you please review this. Thanks.

Copy link

github-actions bot commented Apr 9, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Copy link

github-actions bot commented May 6, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants