dynatrace-oss / OneAgent-SDK-Python-AutoInstrumentation

autodynatrace, a python library that implements automatic instrumentation using the OneAgent SDK for Python
Other
62 stars 28 forks source link

Encountered with an Exception ArgumentError with auto-instrumentation - Attempt to pass non-string type to SDK function expecting a string #72

Closed ConnectWise-Lalit closed 1 year ago

ConnectWise-Lalit commented 1 year ago

We have encountered with an Exception ArgumentError after installing autodynatrace sdk in django application - ArgumentError argument 2: <class 'ValueError'>: Attempt to pass non-string type to SDK function expecting a string. Actual type: <class 'psycopg2.sql.Composed'>

Detailed error


argument 2: <class 'ValueError'>: Attempt to pass non-string type to SDK function expecting a string. Actual type: <class 'psycopg2.sql.Composed'>
oneagent/sdk/__init__.py in trace_sql_database_request at line 156

System

        :rtype: tracers.DatabaseRequestTracer
        '''
        assert isinstance(database, DbInfoHandle)
        return tracers.DatabaseRequestTracer(
            self._nsdk,
            self._nsdk.databaserequesttracer_create_sql(database.handle, sql))
    def trace_incoming_web_request(
            self,
            webapp_info,
            url,
database   

<oneagent.common.DbInfoHandle object at 0x7f9b358b5fd0>
self    
<oneagent.sdk.SDK object at 0x7f9b5b1e6c50>
sql 

image

dlopes7 commented 1 year ago

Please test with autodynatrace 1.1.1, an update was released to pypi.