Skip to content

Commit 0e37a51

Browse files
committed
Use asgi_version in Starlite, Litestar too
1 parent 155e9aa commit 0e37a51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sentry_sdk/integrations/litestar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def __init__(self, app, span_origin=LitestarIntegration.origin):
8585
transaction_style="endpoint",
8686
mechanism_type="asgi",
8787
span_origin=span_origin,
88+
asgi_version=3,
8889
)
8990

9091
def _capture_request_exception(self, exc):
@@ -116,7 +117,6 @@ def injection_wrapper(self, *args, **kwargs):
116117
*(kwargs.get("after_exception") or []),
117118
]
118119

119-
SentryLitestarASGIMiddleware.__call__ = SentryLitestarASGIMiddleware._run_asgi3 # type: ignore
120120
middleware = kwargs.get("middleware") or []
121121
kwargs["middleware"] = [SentryLitestarASGIMiddleware, *middleware]
122122
old__init__(self, *args, **kwargs)

sentry_sdk/integrations/starlite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def __init__(self, app, span_origin=StarliteIntegration.origin):
6565
transaction_style="endpoint",
6666
mechanism_type="asgi",
6767
span_origin=span_origin,
68+
asgi_version=3,
6869
)
6970

7071

@@ -94,7 +95,6 @@ def injection_wrapper(self, *args, **kwargs):
9495
]
9596
)
9697

97-
SentryStarliteASGIMiddleware.__call__ = SentryStarliteASGIMiddleware._run_asgi3 # type: ignore
9898
middleware = kwargs.get("middleware") or []
9999
kwargs["middleware"] = [SentryStarliteASGIMiddleware, *middleware]
100100
old__init__(self, *args, **kwargs)

0 commit comments

Comments
 (0)