Replies: 1 comment
-
Well, I ended up doing the sync/async Gotta say, the placement of the SDK async warning exclusively inside the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've got a synchronous,
wsgi.py
based Django project.sentry_sdk.init()
is called insettings.py
as instructed byDjangoIntegration
docs.I've now added a separate, partially async, long-running worker script. It needs to use some Django facilities, so it calls
django.setup()
at the top level of the module. This, of course, ends up callinginit()
in a sync context as the settings are loaded.The docs for the
asyncio
integration state the following:I'm not (yet) using
asyncio
integration, but that warning seems to apply regardless. And indeed, some of the Sentry events from the async script are a bit odd (traces being listed asUnknown
in particular), though I'm not sure if this is the reason—it could be some lack of configuration, missing spans etc.Do I need to move
sentry_sdk.init()
out of Django settings and e.g. produce helper functions (onedef
, oneasync def
) for initializing the SDK? For example, I'd call the sync version inwsgi.py
for my Django app and call the async version in some suitable async one-time initialization function inside the async worker script.Beta Was this translation helpful? Give feedback.
All reactions