Sentry init only in __init__.py suffices?

Quite new to sentry and could not find my question in the docs.

Let’s say we have a project with 30 python scripts. Does it suffice to put sentry_sdk.init(..) in your __init__.py and will it track the errors in all the 30 python scripts? Or do we have to put sentry_sdk.init in every script to track the errors?

Furthermore, I am using the @serverless_function since we run our projects on Azure functions.

You need to initialize the Python SDK once per OS process, and there ideally as early as possible in the import-chain.

So you can put init() into just one file, but every process needs to import that file at some point.

I don’t know your project layout but __init__ is usually imported all the time, so it sounds about right to only put it there.

Thanks for the clarification, will try and share the results here.

Would be nice if there was an example or at least something mentioned about this in the docs. I think this is a vital point of using Sentry in bigger projects.