Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions sentry_sdk/integrations/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from sentry_sdk.ai.monitoring import record_token_usage
from sentry_sdk.ai.utils import get_start_span_function, set_data_normalized
from sentry_sdk.consts import SPANDATA
from sentry_sdk.tracing_utils import set_span_errored

if TYPE_CHECKING:
from typing import Any, Callable, Iterator
Expand Down Expand Up @@ -83,8 +82,6 @@ def setup_once() -> None:


def _capture_exception(exc: "Any") -> None:
set_span_errored()

event, hint = event_from_exception(
exc,
client_options=sentry_sdk.get_client().options,
Expand Down Expand Up @@ -154,7 +151,7 @@ def new_chat(*args: "Any", **kwargs: "Any") -> "Any":
exc_info = sys.exc_info()
with capture_internal_exceptions():
_capture_exception(e)
span.__exit__(None, None, None)
span.__exit__(*exc_info)
reraise(*exc_info)

with capture_internal_exceptions():
Expand Down
1 change: 0 additions & 1 deletion tests/integrations/cohere/test_cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def test_span_status_error(sentry_init, capture_events):
assert error["level"] == "error"
assert transaction["spans"][0]["status"] == "internal_error"
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
assert transaction["contexts"]["trace"]["status"] == "internal_error"


@pytest.mark.parametrize(
Expand Down
Loading