getsentry / getsentry/sentry-python

Automatic propagation of scope with gevent and gunicorn

Đang mở
#1,028 6 bình luận 1 reaction 0 người được giao Xem trên GitHub
Errors Feature Integration: gevent/eventlet Python
Ngôn ngữ chính
Python
Star
2.2k
Fork
669
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
213

Mô tả

### Environment

Which SDK and version?
sentry-sdk==0.20.2
gevent==21.1.2
gunicorn==20.0.4

### Steps to Reproduce

I have this code:
```
from gevent import monkey
monkey.patch_all()

import os
import bottle
import gevent
import sentry_sdk
from sentry_sdk.integrations.threading import ThreadingIntegration

sentry_kwargs = {
"environment": "sentry-test",
"ignore_errors": ["greenlet.GreenletExit"],
"dsn": os.environ["SENTRY_DSN"],
"integrations": [ThreadingIntegration(propagate_hub=True)]
}
sentry_sdk.init(**sentry_kwargs)

@bottle.route('/request')
def request():
with sentry_sdk.configure_scope() as scope:
scope.set_tag("url", bottle.request.path)
print(sentry_sdk.Hub.current.scope)
print(sentry_sdk.Hub.current.scope._tags)
gevent.spawn(_request_call)
return {}

def _request_call():
print(sentry_sdk.Hub.current.scope)
print(sentry_sdk.Hub.current.scope._tags)
```

### Expected Result

I would expect `ThreadingIntegration(propagate_hub=True)` would propagate scope to gevent, but it seems it's not the case.

### Actual Result
```

{'url': '/request'}

{}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.