Skip to content

Commit f0be3a9

Browse files
committed
Remove unsupported SPANSTATUS.ERROR
1 parent 804af29 commit f0be3a9

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

tests/integrations/anthropic/test_anthropic.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def test_exception_message_create(sentry_init, capture_events):
701701

702702
(event, transaction) = events
703703
assert event["level"] == "error"
704-
assert transaction["contexts"]["trace"]["status"] == "error"
704+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
705705

706706

707707
def test_span_status_error(sentry_init, capture_events):
@@ -722,8 +722,8 @@ def test_span_status_error(sentry_init, capture_events):
722722

723723
(error, transaction) = events
724724
assert error["level"] == "error"
725-
assert transaction["spans"][0]["tags"]["status"] == "error"
726-
assert transaction["contexts"]["trace"]["status"] == "error"
725+
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
726+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
727727

728728

729729
@pytest.mark.asyncio
@@ -745,8 +745,8 @@ async def test_span_status_error_async(sentry_init, capture_events):
745745

746746
(error, transaction) = events
747747
assert error["level"] == "error"
748-
assert transaction["spans"][0]["tags"]["status"] == "error"
749-
assert transaction["contexts"]["trace"]["status"] == "error"
748+
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
749+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
750750

751751

752752
@pytest.mark.asyncio
@@ -767,7 +767,7 @@ async def test_exception_message_create_async(sentry_init, capture_events):
767767

768768
(event, transaction) = events
769769
assert event["level"] == "error"
770-
assert transaction["contexts"]["trace"]["status"] == "error"
770+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
771771

772772

773773
def test_span_origin(sentry_init, capture_events):

tests/integrations/cohere/test_cohere.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def test_span_status_error(sentry_init, capture_events):
181181

182182
(error, transaction) = events
183183
assert error["level"] == "error"
184-
assert transaction["spans"][0]["tags"]["status"] == "error"
185-
assert transaction["contexts"]["trace"]["status"] == "error"
184+
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
185+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
186186

187187

188188
@pytest.mark.parametrize(

tests/integrations/huggingface_hub/test_huggingface_hub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def test_chat_completion_api_error(
792792
assert span["op"] == "gen_ai.chat"
793793
assert span["description"] == "chat test-model"
794794
assert span["origin"] == "auto.ai.huggingface_hub"
795-
assert span.get("tags", {}).get("status") == "error"
795+
assert span.get("tags", {}).get("status") == "internal_error"
796796

797797
assert (
798798
error["contexts"]["trace"]["trace_id"]
@@ -835,9 +835,9 @@ def test_span_status_error(sentry_init, capture_events, mock_hf_api_with_errors)
835835
assert sp["op"] == "http.client"
836836

837837
assert span is not None
838-
assert span["tags"]["status"] == "error"
838+
assert span["tags"]["status"] == "internal_error"
839839

840-
assert transaction["contexts"]["trace"]["status"] == "error"
840+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
841841

842842

843843
@pytest.mark.httpx_mock(assert_all_requests_were_expected=False)

tests/integrations/langchain/test_langchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ def test_span_status_error(sentry_init, capture_events):
347347

348348
(error, transaction) = events
349349
assert error["level"] == "error"
350-
assert transaction["spans"][0]["tags"]["status"] == "error"
351-
assert transaction["contexts"]["trace"]["status"] == "error"
350+
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
351+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
352352

353353

354354
def test_span_origin(sentry_init, capture_events):

tests/integrations/openai/test_openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ def test_span_status_error(sentry_init, capture_events):
440440

441441
(error, transaction) = events
442442
assert error["level"] == "error"
443-
assert transaction["spans"][0]["tags"]["status"] == "error"
444-
assert transaction["contexts"]["trace"]["status"] == "error"
443+
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
444+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
445445

446446

447447
@pytest.mark.asyncio

tests/integrations/openai_agents/test_openai_agents.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,8 @@ async def test_span_status_error(sentry_init, capture_events, test_agent):
724724

725725
(error, transaction) = events
726726
assert error["level"] == "error"
727-
assert transaction["spans"][0]["tags"]["status"] == "error"
728-
assert transaction["contexts"]["trace"]["status"] == "error"
727+
assert transaction["spans"][0]["tags"]["status"] == "internal_error"
728+
assert transaction["contexts"]["trace"]["status"] == "internal_error"
729729

730730

731731
@pytest.mark.asyncio
@@ -827,7 +827,7 @@ async def test_mcp_tool_execution_spans(sentry_init, capture_events, test_agent)
827827
)
828828

829829
# Verify no error status since error was None
830-
assert mcp_tool_span.get("tags", {}).get("status") != "error"
830+
assert mcp_tool_span.get("tags", {}).get("status") != "internal_error"
831831

832832

833833
@pytest.mark.asyncio
@@ -927,7 +927,7 @@ async def test_mcp_tool_execution_with_error(sentry_init, capture_events, test_a
927927
assert mcp_tool_span["data"]["gen_ai.tool.output"] is None
928928

929929
# Verify error status was set
930-
assert mcp_tool_span["tags"]["status"] == "error"
930+
assert mcp_tool_span["tags"]["status"] == "internal_error"
931931

932932

933933
@pytest.mark.asyncio
@@ -1218,4 +1218,4 @@ def failing_tool(message: str) -> str:
12181218

12191219
# Verify error status was set (this is the key test for our patch)
12201220
# The span should be marked as error because the tool execution failed
1221-
assert execute_tool_span["tags"]["status"] == "error"
1221+
assert execute_tool_span["tags"]["status"] == "internal_error"

0 commit comments

Comments
 (0)