Open awoimbee opened 1 day ago
Assigning to @getsentry/support for routing ⏲️
But I can't import sentry_sdk and sentry_sdk.init() in post_fork() because sentry uses sockets and gunicorn patches sockets
Routing to @getsentry/product-owners-settings-integrations for triage ⏲️
Environment
SaaS (https://sentry.io/)
What are you trying to accomplish?
I want to make Sentry with gunicorn work (see https://github.com/benoitc/gunicorn/issues/1855), with the additional complexity that I want the Sentry <> OTel integration.
How are you getting stuck?
Following the python OTel docs, I setup OTel in
gunicorn.conf.py
, inpost_fork()
.But I can't
import sentry_sdk
andsentry_sdk.init()
inpost_fork()
because sentry uses sockets and gunicorn patches sockets withpatch_all()
afterpost_fork()
, right beforepost_worker_init()
. So I need to putsentry_sdk.init()
inpost_worker_init()
.But I can't move my
OTLPSpanExporter()
topost_worker_init()
because then, when the OTel endpoint is down, my API stops responding (because ofTransient error StatusCode.UNAVAILABLE encountered while exporting traces to <endpoint>, retrying in <many>s.
).All in all, my current
gunicorn.conf.py
is:The final issue here is that I keep adding span processors without removing them...
Where in the product are you?
Issues
Link
No response
DSN
https://3503250dac9844d091ff31832b78ebb1@o456214.ingest.sentry.io/5465401
Version
No response