File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 55from datetime import datetime
66
77import sentry_sdk
8- from sentry_sdk .utils import capture_internal_exceptions
8+ from sentry_sdk .utils import capture_internal_exceptions , logger
99from sentry_sdk ._compat import PY2
1010from sentry_sdk ._types import MYPY
1111
@@ -272,9 +272,9 @@ def finish(self, hub=None):
272272 # resolved to a concrete decision. If `sampled` is `None`, it's
273273 # likely that somebody used `with sentry_sdk.Hub.start_span(..)` on a
274274 # non-transaction span and later decided to make it a transaction.
275- assert (
276- self . sampled is not None
277- ), "Need to set transaction when entering span!"
275+ if self . sampled is None :
276+ logger . warning ( "Discarding transaction Span without sampling decision" )
277+
278278 return None
279279
280280 return hub .capture_event (
You can’t perform that action at this time.
0 commit comments