Skip to content

CA-391381: Avoid errors for Partial Callables in observer.py #5638

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

Merged
Merged
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
5 changes: 4 additions & 1 deletion python3/packages/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import runpy
import sys
import traceback
import types
from datetime import datetime, timezone
from logging.handlers import SysLogHandler
from typing import List, Sequence
Expand Down Expand Up @@ -288,7 +289,9 @@ def instrument_function(wrapped, _, args, kwargs):
# class or classmethod
aspan.set_attribute("xs.span.args.str", str(args))
aspan.set_attribute("xs.span.kwargs.str", str(kwargs))
else:
elif isinstance(wrapped, wrapt.PartialCallableObjectProxy):
pass
elif isinstance(wrapped, (types.FunctionType, types.MethodType)):
# function, staticmethod or instancemethod
bound_args = inspect.signature(wrapped).bind(*args, **kwargs)
bound_args.apply_defaults()
Expand Down
Loading