Skip to content

wrap_function_wrapper() issues in genai instrumentations #4444

@lmolkova

Description

@lmolkova

This is GH copilot analysis, I'm the carrier

Problem:

Several instrumentations in this repo call wrapt.wrap_function_wrapper() using keyword arguments (module=..., name=..., wrapper=...). In environments where the resolved wrapt version (or wrap_function_wrapper implementation) does not accept the module keyword,
auto-instrumentation fails with: TypeError: wrap_function_wrapper() got an unexpected keyword argument 'module'

Related context / report: #4442

Affected instrumentations (at least):

Proposed solution

  • Use wrapt API that are consistent between v1 and v2.
  • Keep two versions of wrapt in test requirements - there should be oldest and latest test dependency files
  • Consider calling wrap_function_wrapper in a way that avoids keyword incompatibility, if feasible.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions