Error tracking with Sentry does not work

Hi all,

For our application, we want to monitor & track the errors that pop up in production with Sentry. I added the following in app/init.py:

import sentry_sdk

sentry_sdk.init(
    dsn=<sentry_dsn>
)

This does seem to work for errors that occur in the scripts that are next to the init file, for instance in app/validation.py. However, for scripts in other folders, the error is not tracked by sentry, for instance in app/project/controller.py. Why is this not working?

Also when adding the sentry_sdk.init() in app/project/init.py it does not pick up any errors.

How do you guys track the errors made in production?

i redacted your sentry key

Hi Marlies,
welcome to the forum!

How do you guys track the errors made in production?

to my knowledge we donโ€™t use sentry in apps that we create.

we are thinking about adding some error tracking as a core platform feature, so Iโ€™m interested to hear what youโ€™re looking for and what your experiences are with sentry.

my own experience with sentry is that it tracks uncaught exceptions. this might not work inside a controller environment since every app calculation is wrapped in a big try, except loop that catches exceptions and sends the result to the platform. why this would work for the app.validation.py file is unclear to me.

maybe something else can chime in with their experience.
otherwise we need a simple minimal app as an example to reproduce your situation.

Looked into this and seems not trivial to fix at the moment. Will report back if we have more information on a potential solution direction.