plainx-sentry 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plainx/sentry/middleware.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sentry_sdk
|
|
2
2
|
from plain.runtime import settings
|
|
3
|
-
from sentry_sdk.tracing import
|
|
3
|
+
from sentry_sdk.tracing import TransactionSource
|
|
4
4
|
from sentry_sdk.utils import capture_internal_exceptions
|
|
5
5
|
|
|
6
6
|
try:
|
|
@@ -66,10 +66,9 @@ class SentryMiddleware:
|
|
|
66
66
|
|
|
67
67
|
return event
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
scope.add_event_processor(event_processor)
|
|
69
|
+
# Reset the scope (and breadcrumbs) for each request
|
|
70
|
+
scope = sentry_sdk.get_isolation_scope()
|
|
71
|
+
scope.add_event_processor(event_processor)
|
|
73
72
|
|
|
74
73
|
# Sentry's Django integration patches the WSGIHandler.
|
|
75
74
|
# We could make our own WSGIHandler and patch it or call it directly from gunicorn,
|
|
@@ -119,15 +118,14 @@ class SentryWorkerMiddleware:
|
|
|
119
118
|
extra["plain.worker"] = {"job": job.as_json()}
|
|
120
119
|
return event
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
scope.add_event_processor(event_processor)
|
|
121
|
+
# Reset the scope (and breadcrumbs) for each job
|
|
122
|
+
scope = sentry_sdk.get_isolation_scope()
|
|
123
|
+
scope.add_event_processor(event_processor)
|
|
126
124
|
|
|
127
125
|
with sentry_sdk.start_transaction(
|
|
128
126
|
op="plain.worker.job",
|
|
129
127
|
name=f"job:{job.job_class}",
|
|
130
|
-
source=
|
|
128
|
+
source=TransactionSource.TASK,
|
|
131
129
|
) as transaction:
|
|
132
130
|
if connection:
|
|
133
131
|
# Also get spans for db queries
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plainx-sentry
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Author-email: Dave Gaeddert <dave.gaeddert@gmail.com>
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: sentry-sdk>=
|
|
6
|
+
Requires-Dist: sentry-sdk>=2.24.0
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
|
|
9
9
|
# plainx-sentry
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
plainx/sentry/__init__.py,sha256=Klz3mH_itM2RXzJ_sWWJRIoZcS0jCRxWrhVVIPsG5FY,123
|
|
2
2
|
plainx/sentry/config.py,sha256=EwMnY3DaanIGkgtKD_4h8ncx6MH_MxOML8BF5Hx5GBA,723
|
|
3
3
|
plainx/sentry/default_settings.py,sha256=DNX6OQ0-BqfjyWuszW7JnZhiDn0tGtS3Fa2W7VbTIF8,564
|
|
4
|
-
plainx/sentry/middleware.py,sha256=
|
|
4
|
+
plainx/sentry/middleware.py,sha256=DXBeKKp4s98__nGfsjbutRjEeNkFNwHRpd5Vahws9eY,5516
|
|
5
5
|
plainx/sentry/templates.py,sha256=YovKIswcsjLRjHdmRzdaxG1PHjGfz8fc5TeNE9wcYQA,2046
|
|
6
6
|
plainx/sentry/templates/sentry/js.html,sha256=aOjWAwuUaecGbC-5yZWP1aaGyYAcM-GK0dru-4VOYoE,491
|
|
7
|
-
plainx_sentry-0.
|
|
8
|
-
plainx_sentry-0.
|
|
9
|
-
plainx_sentry-0.
|
|
7
|
+
plainx_sentry-0.4.0.dist-info/METADATA,sha256=oLlsn9RHvE5HtYEu37nlkdiJIdk-ohngTxlwBoA31lg,1559
|
|
8
|
+
plainx_sentry-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
plainx_sentry-0.4.0.dist-info/RECORD,,
|
|
File without changes
|