Skip to content

Commit 6c81965

Browse files
committed
.
1 parent a35045a commit 6c81965

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

sentry_sdk/integrations/sanic.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,16 @@ async def _context_enter(request: "Request") -> None:
179179
scope.add_event_processor(_make_request_processor(weak_request))
180180

181181
if is_span_streaming_enabled:
182+
integration = client.get_integration(SanicIntegration)
183+
if (
184+
isinstance(integration, SanicIntegration)
185+
and integration._unsampled_statuses
186+
):
187+
warnings.warn(
188+
"The `unsampled_statuses` option of SanicIntegration has no effect when span streaming is enabled.",
189+
stacklevel=2,
190+
)
191+
182192
sentry_sdk.traces.continue_trace(dict(request.headers))
183193
scope.set_custom_sampling_context({"sanic_request": request})
184194

@@ -236,12 +246,6 @@ async def _context_exit(
236246

237247
span.end()
238248

239-
if integration and integration._unsampled_statuses:
240-
warnings.warn(
241-
"The unsampled_statuses SanicIntegration option has no effect when span streaming is active.",
242-
stacklevel=2,
243-
)
244-
245249
else:
246250
span.set_http_status(response_status)
247251
span.sampled &= (

0 commit comments

Comments
 (0)