Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Remove the
get_dict
methods from the clients #14149Remove the
get_dict
methods from the clients #14149Changes from 1 commit
280f25a
a64e180
File filter
Filter by extension
Conversations
Jump to
get_dict
methods from the clientsThere are no files selected for viewing
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.
To reviewer: This test with
max_partition_contexts
set to 1 does not make sense to me because:get_consumer_offsets_dict
to return{("consumer_group1", "topic1", "partition1"): 2}
, so with alen
to 1get_highwater_offsets_dict
to return{("topic1", "partition1"): 3, ("topic2", "partition2"): 3}
len(get_consumer_offsets_dict) > limit
with limit=1, we do not even run theget_highwater_offsets
methods, soget_highwater_offsets_dict
should return an empty dict in that case.integrations-core/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
Lines 46 to 51 in dc5d5cb
To me, this test should run both methods and return more contexts than we should handle from the
highwater
method and then, skip some contexts. So here we now have 3 contexts (1 consumer, 2 highwaters) with a limit set to 2, we should only emit 2 metricsThere 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.
Ah that is a good catch! I should have made an assert here to verify that
get_highwater_offsets()
was actually called in the first place rather than just returning a mockedget_highwater_offsets_dict()
.