This fix just ensure that any class:yarl.URL objects are cast to a string before passing to the dynatrace sdk.
We've applied this fix to a service that was hitting this error condition and validated that it's working for us.
Original error stack trace:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiobotocore/httpsession.py", line 208, in send
response = await self._session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/autodynatrace/wrappers/aiohttp/wrapper.py", line 17, in dynatrace_request
with sdk.trace_outgoing_web_request(url, method, headers) as tracer:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/oneagent/sdk/__init__.py", line 260, in trace_outgoing_web_request
self._nsdk, self._nsdk.outgoingwebrequesttracer_create(url, method))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ctypes.ArgumentError: argument 1: ValueError: Attempt to pass non-string type to SDK function expecting a string. Actual type: <class 'yarl.URL'>
Describe the bug AIOHTTP can make a client session request with a str or class:yarl.URL instance.
The dynatrace sdk.trace_outgoing_web_request is expecting a string.
This fix just ensure that any class:yarl.URL objects are cast to a string before passing to the dynatrace sdk.
We've applied this fix to a service that was hitting this error condition and validated that it's working for us.
Original error stack trace: AIOHTTP can make a client session request with a str or class:yarl.URL instance.
The dynatrace sdk.trace_outgoing_web_request is expecting a string.
This fix just ensure that any class:yarl.URL objects are cast to a string before passing to the dynatrace sdk.
We've applied this fix to a service that was hitting this error condition and validated that it's working for us.
Original error stack trace:
To Reproduce Steps to reproduce the behavior:
Additional context We have fixed this error by updating the wrapper to convert the yarl.url into a string before sending it along that way this error does not occur again. The link to the PR is: https://github.com/dynatrace-oss/OneAgent-SDK-Python-AutoInstrumentation/pull/92
please let us know if there is any other info we can provide