Skip to content
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

Get ConsumerGroups information from ConsumerGroupRegister and update tracked Lag when assigned consumer stops consuming #131

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

detro
Copy link
Contributor

@detro detro commented Feb 4, 2024

Enables: #114

Here I introduce the ConsumerGroupRegister.

This is not too different from other *Register, like ClusterStatusRegister: its focus is on holding the information about the available, active ConsumerGroups in the cluster.

In addition to caching the information about ConsumerGroups, it enacts the role of "remembering the group for a certain amount of time": this is embodied in the --forget-group-after new command line parameter. This new register is going to not remove any of the ConsumerGroups that stop being reported by the cluster, for a fixed amount of time.

This is to help with the fact that, in case of an outage, a Group could disappear for various reasons (a crash?): if the Group was immediately forgotten, it would make the metric produced by Kommitted disappear.

This way the metric will keep being produced, and the internal estimator will use the known previous data points to estimating the growth of latency (that is ultimately the whole point of this service).

Additionally, this change allows for #114 to happen: to calculate lag for clusters hosted on Confluent Cloud, we need to refactor how the KommittedOffsetsData is produced, by allowing for an alternative KommittedOffsetsDataEmitter to be created (e.g. ConfluentCloudOffsetsDataEmitter). The API offered by Committed Offsets require a prior knowledge of the available groups, so the register here will work as a source of truth, for when the API calls are done to get to the offset information of the specific group.

The main.rs will have to then swap the default KommittedOffsetsDataEmitter with the ConfluentCloudOffsetsDataEmitter, based on input. But this is for a follow up PR.

@detro detro added this to the vNEXT milestone Feb 4, 2024
@detro detro added enhancement New feature or request rust Pull requests that update Rust code module:consumer_groups module:lag_register labels Feb 4, 2024
@detro detro changed the title The set of ConsumerGroups will now come from ConsumerGroupRegister Get ConsumerGroups information from ConsumerGroupRegister Feb 5, 2024
@detro detro force-pushed the detro/114-consumer_groups_register branch from b94ca68 to acb44d5 Compare February 18, 2024 21:57
@detro detro force-pushed the detro/114-consumer_groups_register branch from acb44d5 to 5fa7c82 Compare February 19, 2024 08:28
This means that the group is gone, so we don't want to remove it from the register just yet.
1. Check if `ConsumerGroupRegister` has changed (using the hash) and, if it did, updating it's internal tracked group lags
2. Check if any known `Lag` is stale, and if it is updating the lag estimation considering the latest tracked produced offsets
@detro detro changed the title Get ConsumerGroups information from ConsumerGroupRegister Get ConsumerGroups information from ConsumerGroupRegister and update tracked Lag when assigned consumer stops consuming Feb 28, 2024
@detro detro modified the milestones: vNEXT, vNEXTNEXT Apr 15, 2024
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.

1 participant