-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for fetching consumer offsets stored in Kafka to monitor_unlisted_consumer_groups
#3957
Add support for fetching consumer offsets stored in Kafka to monitor_unlisted_consumer_groups
#3957
Conversation
This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community. |
monitor_unlisted_consumer_groups
Agent v6 only has one instance per instances, so we don't need to have a separate cache... just cache the client on the instance. This also lets us be sure we are closing the client at the end of the check to avoid stale connections on older kafka brokers. This cleanup will make life simpler when the check is refactored as part of #3957.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs review
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
kafka_consumer/datadog_checks/kafka_consumer/data/conf.yaml.example
Outdated
Show resolved
Hide resolved
This is a major refactor of `kafka_consumer` check with a new code path that will exist alongside the legacy code path. The new code path: 1. Eliminates legacy cruft: * drops support for fetching consumer offsets from zookeeper * drops support for brokers < 0.10.2 which do not support fetching all known offsets for a consumer group * migrates from the hand-rolled group-coordinator lookup code, retries, etc to relying on `kafka-python`'s `KafkaAdminClient` to handle all that under the covers 2. Adds support for `monitor_unlisted_consumer_groups` to fetch consumer offsets from Kafka 3. Refactors from sync to async using callbacks for improved performance, especially with larger clusters and more consumer groups. To clarify: Fetching consumer offsets from older brokers and from zookeeper is still supported, it just uses the legacy code path instead of this new code path. This has been under discussion in various forms for over two years, see #423 and #2730. The main blocker was coming up with a clean way to support legacy features like fetching from Zookeeper / older brokers while simultaneously migrating to `kafka-python`'s new `KafkaAdminClient` which only supports brokers >= `0.10.0`. After several rounds of discussion, the decision was to move the legacy code into a separate file and start from scratch with a new implementation of the check which would be the primary one for new features moving forward.
Codecov Report
|
6 similar comments
Codecov Report
|
Codecov Report
|
Codecov Report
|
Codecov Report
|
Codecov Report
|
Codecov Report
|
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for docs
Blocked on dpkp/kafka-python#1903 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for docs
Add support for fetching consumer offsets stored in Kafka to
monitor_unlisted_consumer_groups
Major refactor of
kafka_consumer
check with a new code path that will exist alongside the legacy code path. The new code path:kafka-python
'sKafkaAdminClient
to handle all that under the coversmonitor_unlisted_consumer_groups
to fetch consumer offsets from KafkaTo clarify: Fetching consumer offsets from older brokers and from zookeeper is still supported, it just uses the legacy code path instead of this new code path.
Motivation
This has been under discussion in various forms for over two years, see #423 and #2730. The main blocker was coming up with a clean way to support legacy features like fetching from Zookeeper / older brokers while simultaneously migrating to
kafka-python
's newKafkaAdminClient
which only supports brokers >=0.10.0
. After several rounds of discussion, the decision was to move the legacy code into a separate file and start from scratch with a new implementation of the check which would be the primary one for new features moving forward.Status: Working
The remaining TODO's mentioned in the code are small refinements that I am unlikely to have time to do, but wanted to still note for later developers.
This depends on unreleased code within
kafka-python
, so can't be merged untilkafka-python
releases1.4.7
(I'm on the maintainer team, so will help make that happen).My personal TODO list:
monitor_unlisted_consumer_groups
#2730conf.yaml.example
from [kafka_consumer] Add kafka support formonitor_unlisted_consumer_groups
#2730monitor_unlisted_consumer_groups
#2730 to make sure I incorporate any additional necessary changes such as A6 and python3 related changeskafka-python
dep version to pull in the patches required for callbacks and faster polling