Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- `opentelemetry-instrumentation-confluent-kafka`: Fix incorrect number of argument to `_inner_wrap_close`
([#3922](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3922))
- `opentelemetry-instrumentation-botocore`: bedrock: only decode JSON input buffer in Anthropic Claude streaming
([#3875](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3875))
- `opentelemetry-instrumentation-aiohttp-client`, `opentelemetry-instrumentation-aiohttp-server`: Fix readme links and text
Expand Down
2 changes: 1 addition & 1 deletion docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ botocore~=1.0
boto3~=1.0
cassandra-driver~=3.25
celery>=4.0
confluent-kafka>= 1.8.2,<= 2.11.0
confluent-kafka>= 1.8.2,<= 2.11.1
elasticsearch>=6.0,<9.0
flask~=2.0
falcon~=2.0
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
| [opentelemetry-instrumentation-cassandra](./opentelemetry-instrumentation-cassandra) | cassandra-driver ~= 3.25,scylla-driver ~= 3.25 | No | development
| [opentelemetry-instrumentation-celery](./opentelemetry-instrumentation-celery) | celery >= 4.0, < 6.0 | No | development
| [opentelemetry-instrumentation-click](./opentelemetry-instrumentation-click) | click >= 8.1.3, < 9.0.0 | No | development
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.11.0 | No | development
| [opentelemetry-instrumentation-confluent-kafka](./opentelemetry-instrumentation-confluent-kafka) | confluent-kafka >= 1.8.2, <= 2.11.1 | No | development
| [opentelemetry-instrumentation-dbapi](./opentelemetry-instrumentation-dbapi) | dbapi | No | development
| [opentelemetry-instrumentation-django](./opentelemetry-instrumentation-django) | django >= 1.10 | Yes | development
| [opentelemetry-instrumentation-elasticsearch](./opentelemetry-instrumentation-elasticsearch) | elasticsearch >= 6.0 | No | development
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [

[project.optional-dependencies]
instruments = [
"confluent-kafka >= 1.8.2, <= 2.11.0",
"confluent-kafka >= 1.8.2, <= 2.11.1",
Copy link
Contributor

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but we can do it in a separate PR since I don't think this is related to the version

]

[project.entry-points.opentelemetry_instrumentor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup we just missed passing args, kwargs

return ConfluentKafkaInstrumentor.wrap_close(
self._consumer.close, self
self._consumer.close, self, args, kwargs
)

def committed(self, partitions, timeout=-1):
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just adding args, kwargs in _inner_wrap_close should be enough for this fix. We missed it in #2640

)

wrapt.wrap_function_wrapper(
AutoInstrumentedProducer,
Expand Down Expand Up @@ -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
Expand Up @@ -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",)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
asgiref==3.8.1
confluent-kafka==2.11.0
confluent-kafka==2.11.1
Deprecated==1.2.14
iniconfig==2.0.0
packaging==24.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"instrumentation": "opentelemetry-instrumentation-click==0.60b0.dev",
},
{
"library": "confluent-kafka >= 1.8.2, <= 2.11.0",
"library": "confluent-kafka >= 1.8.2, <= 2.11.1",
"instrumentation": "opentelemetry-instrumentation-confluent-kafka==0.60b0.dev",
},
{
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.