New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry with eventlet #1036
Comments
Can you add |
Same. Nothing happens. Without flush I got.
Program ends by itself instantly. With flush. No output and no message in sentry |
Problem definitely in eventlet.monkey_patch() if that line is commented everything works fine. |
Just for record, copying workaround from our tracker. Calling monkey_patch before even importing sentry_sdk works.
I understand it's well below acceptable and yet don't have a better solution right now. Successful fix would start with analyzing what side effects are produced by |
@temoto Thanks alot. I had no idea that import sentry_sdk was the problem :) |
only work on import is this: sentry-python/sentry_sdk/utils.py Line 840 in 37105d9
However, flush etc should not really break regardless of whether contextvars or thread locals are used. So I think it's more related to threading patches that would affect |
@Randomneo can you check |
@untitaker I not quite get how I supposed to check it. But this code outputs:
Output:
It also easy to reproduce on your machine using code sample in issue description. I'm using latest stable versions of packages |
I'm getting the following recursionerror in addition when it's broken. As you said, if I move the SDK import after the monkeypatch, the issue disappears. You need to add
In addition, the issue can be reproduced without Sentry. The urllib3 usage is straight from their README:
This will crash in the same way. |
This should be fixed in just released eventlet v0.30.2 but (AFAIK) is not related to current problem. My two cents to checking # test.py
import sentry_sdk
sentry_sdk.init('http://1234@foo/1')
print("[before eventlet] Hub.current.client:",sentry_sdk.Hub.current.client)
import eventlet
eventlet.monkey_patch()
print("[ after eventlet] Hub.current.client:", sentry_sdk.Hub.current.client)
At the very least, it refers to same object after patching, so that's something about thread locals. Still maybe thread locals are messed up in another place. |
0.30.2 exhibits the same problem for me. You need to both send an event via the SDK and have debug=True added |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Quick update: I think this is a important issue to improve sentry with async Python. I will try to review and test this. |
Environment
self-hosted sentry 9.0.0
python 3.9/3.7
sentry_sdk version: 0.20.3
eventlet version: 0.30.1
greenlet version: 1.0.0
Steps to Reproduce
Expected Result
getting message in sentry
Actual Result
Nothing happens. No errors thrown. No clear documentation for that problem. Here issue for eventlet.
If sentry_sdk can't be used with eventlet and there no possible way to combine them it should be in documentation.
Please correct me if i'm missing something.
The text was updated successfully, but these errors were encountered: