You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like when we add Sentry to a Django application with MongoDB, Djongo seems to be monkeypatching the connection object that we rely on, causing the django integration to break. The error thrown is:
File "/Users/user/opt/anaconda3/envs/ZETA/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/Users/user/opt/anaconda3/envs/ZETA/lib/python3.8/site-packages/django/db/backends/utils.py", line 98, in execute
return super().execute(sql, params)
File "/Users/user/opt/anaconda3/envs/ZETA/lib/python3.8/site-packages/sentry_sdk/integrations/django/__init__.py", line 615, in execute
_set_db_data(span, self)
File "/Users/user/opt/anaconda3/envs/ZETA/lib/python3.8/site-packages/sentry_sdk/integrations/django/__init__.py", line 657, in _set_db_data
cursor_or_db.connection.get_dsn_parameters()
File "/Users/user/opt/anaconda3/envs/ZETA/lib/python3.8/site-packages/pymongo/collection.py", line 3491, in __call__
raise TypeError("'Collection' object is not callable. If you meant to "
TypeError: 'Collection' object is not callable. If you meant to call the 'get_dsn_parameters' method on a 'Collection' object it is failing because no such method exists.
Solution Brainstorm
We should add support for Djongo so that adding Sentry's Django SDK works without any issues.
Activity
sentrivana commentedon Oct 11, 2023
@InterstellarStella Looking at the stacktrace it seems like they're on a slightly older Python SDK version. Upgrading to 1.32.0 might help because we're now a bit more careful about accessing the params: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/django/__init__.py#L668-L673
sentrivana commentedon Oct 11, 2023
Hey @omarsagheer, thanks for the follow up! Just to clarify, you're on SDK version 1.32.0 and it still required the patch you mentioned?
1 remaining item
sentrivana commentedon Oct 11, 2023
Thanks! We'll look into fixing that in the next release.