-
Notifications
You must be signed in to change notification settings - Fork 809
fix: confluent-kafka: fix incorrect number of arguments #3922
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,8 +132,8 @@ def produce(self, topic, value=None, *args, **kwargs): # pylint: disable=keywor | |
|
|
||
|
|
||
| class AutoInstrumentedConsumer(Consumer): | ||
| def __init__(self, config): | ||
| super().__init__(config) | ||
| def __init__(self, *args, **kwargs): | ||
| super().__init__(*args, **kwargs) | ||
| self._current_consume_span = None | ||
|
|
||
| # This method is deliberately implemented in order to allow wrapt to wrap this function | ||
|
|
@@ -183,9 +183,9 @@ def __init__(self, consumer: Consumer, tracer: Tracer): | |
| self._current_consume_span = None | ||
| self._current_context_token = None | ||
|
|
||
| def close(self): | ||
| def close(self, *args, **kwargs): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this something that has been changed in 2.11.1 or has been there already? Maybe we should add a docker test.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally only started using in that version, but it doesn't seem to be relevant to confluent Kafka itself, looks to be a change in wrapt that someone forgot to update here |
||
| return ConfluentKafkaInstrumentor.wrap_close( | ||
| self._consumer.close, self | ||
| self._consumer.close, self, args, kwargs | ||
| ) | ||
|
|
||
| def committed(self, partitions, timeout=-1): | ||
|
|
@@ -306,8 +306,10 @@ def _inner_wrap_consume(func, instance, args, kwargs): | |
| func, instance, self._tracer, args, kwargs | ||
| ) | ||
|
|
||
| def _inner_wrap_close(func, instance): | ||
| return ConfluentKafkaInstrumentor.wrap_close(func, instance) | ||
| def _inner_wrap_close(func, instance, args, kwargs): | ||
| return ConfluentKafkaInstrumentor.wrap_close( | ||
| func, instance, args, kwargs | ||
| ) | ||
|
|
||
| wrapt.wrap_function_wrapper( | ||
| AutoInstrumentedProducer, | ||
|
|
@@ -419,7 +421,7 @@ def wrap_consume(func, instance, tracer, args, kwargs): | |
| return records | ||
|
|
||
| @staticmethod | ||
| def wrap_close(func, instance): | ||
| def wrap_close(func, instance, args, kwargs): | ||
| if instance._current_consume_span: | ||
| _end_current_consume_span(instance) | ||
| func() | ||
| func(*args, **kwargs) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,4 @@ | |
| # limitations under the License. | ||
|
|
||
|
|
||
| _instruments = ("confluent-kafka >= 1.8.2, <= 2.11.0",) | ||
| _instruments = ("confluent-kafka >= 1.8.2, <= 2.11.1",) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
What do you think of bumping to
< 2.12.0? Can we expect to not break?