File tree Expand file tree Collapse file tree
tests/integrations/cohere Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from sentry_sdk .ai .monitoring import record_token_usage
77from sentry_sdk .ai .utils import get_start_span_function , set_data_normalized
88from sentry_sdk .consts import SPANDATA
9- from sentry_sdk .tracing_utils import set_span_errored
109
1110if TYPE_CHECKING :
1211 from typing import Any , Callable , Iterator
@@ -83,8 +82,6 @@ def setup_once() -> None:
8382
8483
8584def _capture_exception (exc : "Any" ) -> None :
86- set_span_errored ()
87-
8885 event , hint = event_from_exception (
8986 exc ,
9087 client_options = sentry_sdk .get_client ().options ,
@@ -154,7 +151,7 @@ def new_chat(*args: "Any", **kwargs: "Any") -> "Any":
154151 exc_info = sys .exc_info ()
155152 with capture_internal_exceptions ():
156153 _capture_exception (e )
157- span .__exit__ (None , None , None )
154+ span .__exit__ (* exc_info )
158155 reraise (* exc_info )
159156
160157 with capture_internal_exceptions ():
Original file line number Diff line number Diff line change @@ -183,7 +183,6 @@ def test_span_status_error(sentry_init, capture_events):
183183 assert error ["level" ] == "error"
184184 assert transaction ["spans" ][0 ]["status" ] == "internal_error"
185185 assert transaction ["spans" ][0 ]["tags" ]["status" ] == "internal_error"
186- assert transaction ["contexts" ]["trace" ]["status" ] == "internal_error"
187186
188187
189188@pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments