diff --git a/tests/integrations/anthropic/test_anthropic.py b/tests/integrations/anthropic/test_anthropic.py index 7526e6ad3d..75606a1d35 100644 --- a/tests/integrations/anthropic/test_anthropic.py +++ b/tests/integrations/anthropic/test_anthropic.py @@ -3300,7 +3300,7 @@ def test_exception_message_create( ) if span_streaming: - items = capture_items("event", "transaction") + items = capture_items("event") with pytest.raises(AnthropicError): client.messages.create( @@ -3495,7 +3495,7 @@ async def test_exception_message_create_async( ) if span_streaming: - items = capture_items("event", "transaction") + items = capture_items("event") with pytest.raises(AnthropicError): await client.messages.create( @@ -3768,7 +3768,7 @@ def mock_messages_create(*args, **kwargs): test_messages = [test_message] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic tx"): client.messages.create( @@ -5064,7 +5064,7 @@ def test_system_prompt_with_complex_structure( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): response = client.messages.create( @@ -5420,7 +5420,7 @@ def test_message_with_url_image( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create(max_tokens=1024, messages=messages, model="model") @@ -5492,7 +5492,7 @@ def test_message_with_file_image( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create(max_tokens=1024, messages=messages, model="model") @@ -5608,7 +5608,7 @@ def test_message_with_url_pdf( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create(max_tokens=1024, messages=messages, model="model") @@ -5680,7 +5680,7 @@ def test_message_with_file_document( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create(max_tokens=1024, messages=messages, model="model") @@ -5910,7 +5910,7 @@ def test_binary_content_not_stored_when_pii_disabled( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create(max_tokens=1024, messages=messages, model="model") @@ -5974,7 +5974,7 @@ def test_binary_content_not_stored_when_prompts_disabled( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create(max_tokens=1024, messages=messages, model="model") @@ -6035,7 +6035,7 @@ def test_cache_tokens_nonstreaming( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create( @@ -6117,7 +6117,7 @@ def test_input_tokens_include_cache_write_nonstreaming( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create( @@ -6203,7 +6203,7 @@ def test_input_tokens_include_cache_read_nonstreaming( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create( @@ -6295,7 +6295,7 @@ def test_input_tokens_include_cache_read_streaming( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client._client, @@ -6398,7 +6398,7 @@ def test_stream_messages_input_tokens_include_cache_read_streaming( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client._client, @@ -6485,7 +6485,7 @@ def test_input_tokens_unchanged_without_caching( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="anthropic"): client.messages.create( @@ -6565,7 +6565,7 @@ def test_cache_tokens_streaming( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client._client, @@ -6663,7 +6663,7 @@ def test_stream_messages_cache_tokens( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client._client, diff --git a/tests/integrations/google_genai/test_google_genai.py b/tests/integrations/google_genai/test_google_genai.py index fb50c9cc7d..16c556031b 100644 --- a/tests/integrations/google_genai/test_google_genai.py +++ b/tests/integrations/google_genai/test_google_genai.py @@ -594,7 +594,7 @@ def test_error_handling( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming or stream_gen_ai_spans: - items = capture_items("event", "transaction") + items = capture_items("event") # Mock an error at the HTTP level with mock.patch.object( @@ -1800,7 +1800,7 @@ def test_embed_content_error_handling( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "event") + items = capture_items("event") # Mock an error at the HTTP level with mock.patch.object( @@ -2210,7 +2210,7 @@ async def test_async_embed_content_error_handling( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "event") + items = capture_items("event") # Mock an error at the HTTP level with mock.patch.object( diff --git a/tests/integrations/langgraph/test_langgraph.py b/tests/integrations/langgraph/test_langgraph.py index db41e0e8d7..b70afe598f 100644 --- a/tests/integrations/langgraph/test_langgraph.py +++ b/tests/integrations/langgraph/test_langgraph.py @@ -170,7 +170,7 @@ def original_compile(self, *args, **kwargs): return MockCompiledGraph(self.name) if stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with patch("sentry_sdk.integrations.langgraph.StateGraph"), start_transaction(): wrapped_compile = _wrap_state_graph_compile(original_compile) @@ -299,7 +299,7 @@ def original_invoke(self, *args, **kwargs): return {"messages": new_messages} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -485,7 +485,7 @@ async def run_test(): return result if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = asyncio.run(run_test()) assert result is not None @@ -610,7 +610,7 @@ def original_invoke(self, *args, **kwargs): raise Exception("Graph execution failed") if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(), pytest.raises( Exception, match="Graph execution failed" @@ -681,7 +681,7 @@ async def run_error_test(): await wrapped_ainvoke(pregel, test_state) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") asyncio.run(run_error_test()) @@ -792,7 +792,7 @@ def original_invoke(self, *args, **kwargs): return {"result": "test"} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -904,7 +904,7 @@ def original_invoke(self, *args, **kwargs): return {"messages": new_messages} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -1028,7 +1028,7 @@ async def run_test(): return result if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = asyncio.run(run_test()) assert result is not None @@ -1151,7 +1151,7 @@ def original_invoke(self, *args, **kwargs): return {"messages": new_messages} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -1274,7 +1274,7 @@ async def run_test(): return result if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = asyncio.run(run_test()) assert result is not None @@ -1374,7 +1374,7 @@ def original_invoke(self, *args, **kwargs): return {"messages": new_messages} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -1491,7 +1491,7 @@ async def run_test(): return result if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = asyncio.run(run_test()) assert result is not None @@ -1609,7 +1609,7 @@ def original_invoke(self, *args, **kwargs): return {"messages": new_messages} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -1737,7 +1737,7 @@ async def run_test(): return result if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = asyncio.run(run_test()) assert result is not None @@ -1881,7 +1881,7 @@ def original_invoke(self, *args, **kwargs): return {"messages": new_messages} if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(): wrapped_invoke = _wrap_pregel_invoke(original_invoke) @@ -1980,7 +1980,7 @@ def __init__(self, content, message_type="human"): pregel = MockPregelInstance(compiled_graph) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="langgraph tx"): # Use the wrapped invoke function directly diff --git a/tests/integrations/litellm/test_litellm.py b/tests/integrations/litellm/test_litellm.py index 831bb90b13..75735db616 100644 --- a/tests/integrations/litellm/test_litellm.py +++ b/tests/integrations/litellm/test_litellm.py @@ -618,7 +618,7 @@ async def test_async_streaming_chat_completion( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -722,7 +722,7 @@ def test_embeddings_create( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.embeddings._client._client, @@ -843,7 +843,7 @@ async def test_async_embeddings_create( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.embeddings._client._client, @@ -960,7 +960,7 @@ def test_embeddings_create_with_list_input( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.embeddings._client._client, @@ -1074,7 +1074,7 @@ async def test_async_embeddings_create_with_list_input( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.embeddings._client._client, @@ -1188,7 +1188,7 @@ def test_embeddings_no_pii( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.embeddings._client._client, @@ -1288,7 +1288,7 @@ async def test_async_embeddings_no_pii( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.embeddings._client._client, @@ -1713,7 +1713,7 @@ def test_multiple_providers( # The provider should be detected by litellm.get_llm_provider assert SPANDATA.GEN_AI_SYSTEM in span["attributes"] elif stream_gen_ai_spans: - items = capture_items("transaction") + items = capture_items("span", "transaction") with mock.patch.object( openai_client.completions._client._client, @@ -2077,7 +2077,7 @@ def test_additional_parameters( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -2191,7 +2191,7 @@ async def test_async_additional_parameters( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -2306,7 +2306,7 @@ def test_no_integration( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -2396,7 +2396,7 @@ async def test_async_no_integration( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -2479,7 +2479,7 @@ def test_response_without_usage( )() if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with start_transaction(name="litellm test"): kwargs = { @@ -2655,7 +2655,7 @@ def test_binary_content_encoding_image_url( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -2780,7 +2780,7 @@ async def test_async_binary_content_encoding_image_url( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -2908,7 +2908,7 @@ def test_binary_content_encoding_mixed_content( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -3022,7 +3022,7 @@ async def test_async_binary_content_encoding_mixed_content( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, @@ -3136,7 +3136,7 @@ def test_binary_content_encoding_uri_type( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, "send", @@ -3254,7 +3254,7 @@ async def test_async_binary_content_encoding_uri_type( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with mock.patch.object( client.completions._client._client, diff --git a/tests/integrations/openai/test_openai.py b/tests/integrations/openai/test_openai.py index dc2a046fa7..e37920628f 100644 --- a/tests/integrations/openai/test_openai.py +++ b/tests/integrations/openai/test_openai.py @@ -2274,7 +2274,7 @@ def test_span_status_error( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("event", "transaction", "span") + items = capture_items("event", "span") with start_transaction(name="test"): client = OpenAI(api_key="z") diff --git a/tests/integrations/pydantic_ai/test_pydantic_ai.py b/tests/integrations/pydantic_ai/test_pydantic_ai.py index 9d84c24c71..6afeb6cc18 100644 --- a/tests/integrations/pydantic_ai/test_pydantic_ai.py +++ b/tests/integrations/pydantic_ai/test_pydantic_ai.py @@ -262,7 +262,7 @@ def failing_model(messages, info): assert spans[0]["status"] == "error" elif stream_gen_ai_spans: - items = capture_items("event", "transaction", "span") + items = capture_items("event", "span") with pytest.raises(RuntimeError, match="model exploded"): await agent.run("Test input") @@ -428,7 +428,7 @@ def failing_model(messages, info): assert spans[0]["status"] == "error" elif stream_gen_ai_spans: - items = capture_items("event", "transaction", "span") + items = capture_items("event", "span") with pytest.raises(RuntimeError, match="model exploded"): agent.run_sync("Test input") @@ -747,7 +747,7 @@ def add_numbers(a: int, b: int) -> int: return a + b if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = await test_agent.run("What is 5 + 3?") @@ -863,7 +863,7 @@ def add_numbers(a: int, b: int) -> float: return a + b if span_streaming or stream_gen_ai_spans: - items = capture_items("event", "transaction", "span") + items = capture_items("event", "span") result = await test_agent.run("What is 5 + 3?") @@ -1000,7 +1000,7 @@ def add_numbers(a: Annotated[int, Field(gt=0, lt=0)], b: int) -> int: return a + b if span_streaming or stream_gen_ai_spans: - items = capture_items("event", "transaction", "span") + items = capture_items("event", "span") result = None with pytest.raises(UnexpectedModelBehavior): @@ -1124,7 +1124,7 @@ def multiply(a: int, b: int) -> int: return a * b if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") async with test_agent.run_stream("What is 7 times 8?") as result: async for _ in result.stream_output(): @@ -1207,7 +1207,7 @@ async def test_model_settings( test_agent_with_settings = get_test_agent_with_settings() if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent_with_settings.run("Test input") @@ -1283,7 +1283,7 @@ async def test_system_prompt_attribute( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await agent.run("Hello") @@ -1375,7 +1375,7 @@ async def test_error_handling( assert spans[1]["is_segment"] is True assert spans[1]["status"] != "error" # Could be None or some other status elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") # Simple run that should succeed await agent.run("Hello") @@ -1426,7 +1426,7 @@ async def test_without_pii( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") test_agent = get_test_agent() await test_agent.run("Sensitive input") @@ -1491,7 +1491,7 @@ def sensitive_tool(data: str) -> str: return f"Processed: {data}" if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Use sensitive tool with private data") @@ -1567,7 +1567,7 @@ async def run_agent(input_text): continue assert span["name"] == "invoke_agent test_agent" elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") # Run 3 agents concurrently results = await asyncio.gather(*[run_agent(f"Input {i}") for i in range(3)]) @@ -1636,7 +1636,7 @@ async def test_message_history( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") # First message await agent.run("Hello, I'm Alice") @@ -1703,7 +1703,7 @@ async def test_gen_ai_system( test_agent = get_test_agent() if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Test input") @@ -1763,7 +1763,7 @@ async def test_include_prompts_false( test_agent = get_test_agent() if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Sensitive prompt") @@ -1821,7 +1821,7 @@ async def test_include_prompts_true( test_agent = get_test_agent() if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Test prompt") @@ -1884,7 +1884,7 @@ def test_tool(value: int) -> int: return value * 2 if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Use the test tool with value 5") @@ -1944,7 +1944,7 @@ async def test_include_prompts_requires_pii( test_agent = get_test_agent() if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Test prompt") @@ -2175,7 +2175,7 @@ async def test_invoke_agent_with_list_user_prompt( assert "First part" in messages_str assert "Second part" in messages_str elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") # Use a list as user prompt await agent.run(["First part", "Second part"]) @@ -2253,7 +2253,7 @@ async def test_invoke_agent_with_instructions( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await agent.run("Test input") @@ -2419,7 +2419,7 @@ async def test_usage_data_partial( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await agent.run("Test input") @@ -2484,7 +2484,7 @@ async def test_agent_data_from_scope( assert spans[1]["name"] == "invoke_agent test_scope_agent" elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") # The integration automatically sets agent in scope during execution await agent.run("Test input") @@ -2536,7 +2536,7 @@ def tool_without_desc(x: int) -> int: return x * 2 if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Use the tool with 5") @@ -2597,7 +2597,7 @@ def calc_tool(value: int) -> int: return value + 10 if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await test_agent.run("Use calc_tool with 5") @@ -2676,7 +2676,7 @@ async def test_message_formatting_with_different_parts( ] if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await agent.run("What did I say?", message_history=history) @@ -2804,7 +2804,7 @@ async def test_agent_without_name( assert "invoke_agent" in spans[1]["name"] elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") await agent.run("Test input") @@ -3011,7 +3011,7 @@ def test_tool(x: int) -> int: ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") # Run with history containing tool return await agent.run("Use test_tool with 5") @@ -3984,7 +3984,7 @@ async def test_binary_content_encoding_image( messages_data = _get_messages_from_span(span_data) assert _find_binary_content(messages_data, "image", "image/png") elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") with sentry_sdk.start_transaction(op="test", name="test"): span = sentry_sdk.start_span(op="test_span") @@ -4082,7 +4082,7 @@ async def test_binary_content_encoding_mixed_content( assert found_text, "Text content should be found" assert _find_binary_content(messages_data, "image", "image/jpeg") elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") with sentry_sdk.start_transaction(op="test", name="test"): span = sentry_sdk.start_span(op="test_span") @@ -4171,7 +4171,7 @@ async def test_binary_content_in_agent_run( ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await agent.run(["Analyze this image:", binary_content]) @@ -4250,7 +4250,7 @@ async def test_set_usage_data_with_cache_tokens( spans[0]["attributes"][SPANDATA.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE] == 20 ) elif stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("transaction") with sentry_sdk.start_transaction(op="test", name="test"): span = sentry_sdk.start_span(op="test_span") @@ -4352,7 +4352,7 @@ def test_image_url_base64_content_in_span( found_image = False if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") with sentry_sdk.start_transaction(op="test", name="test"): image_url = ImageUrl(url=url, **image_url_kwargs) @@ -4463,7 +4463,7 @@ async def test_invoke_agent_image_url( image_url = ImageUrl(url=url, **image_url_kwargs) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") await agent.run([image_url, "Describe this image"]) @@ -4539,7 +4539,7 @@ def multiply_numbers(a: int, b: int) -> int: ) if span_streaming or stream_gen_ai_spans: - items = capture_items("transaction", "span") + items = capture_items("span") result = await agent.run("What is 5 times 3?") assert result is not None diff --git a/tests/integrations/rq/test_rq.py b/tests/integrations/rq/test_rq.py index 9b82a31110..0df5759a1e 100644 --- a/tests/integrations/rq/test_rq.py +++ b/tests/integrations/rq/test_rq.py @@ -302,7 +302,7 @@ def test_tracing_enabled( queue.enqueue(crashing_job, foo=None) worker.work(burst=True) - (error_event,) = (item.payload for item in items) + (error_event,) = (item.payload for item in items if item.type == "event") assert error_event["contexts"]["trace"]["trace_id"] == span.trace_id diff --git a/tests/integrations/rust_tracing/test_rust_tracing.py b/tests/integrations/rust_tracing/test_rust_tracing.py index 743ad1729d..dcd79dcc1a 100644 --- a/tests/integrations/rust_tracing/test_rust_tracing.py +++ b/tests/integrations/rust_tracing/test_rust_tracing.py @@ -83,7 +83,7 @@ def test_on_new_span_on_close( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("span") with sentry_sdk.traces.start_span(name="custom parent"): rust_tracing.new_span(RustTracingLevel.Info, 3) @@ -169,7 +169,7 @@ def test_nested_on_new_span_on_close( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("span") with sentry_sdk.traces.start_span(name="custom parent"): original_sentry_span = sentry_sdk.traces.get_current_span() @@ -343,7 +343,7 @@ def test_on_event_exception( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("event") sentry_sdk.get_isolation_scope().clear_breadcrumbs() with sentry_sdk.traces.start_span(name="custom parent"): @@ -403,7 +403,7 @@ def test_on_event_breadcrumb( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("event") sentry_sdk.get_isolation_scope().clear_breadcrumbs() with sentry_sdk.traces.start_span(name="custom parent"): @@ -458,7 +458,7 @@ def test_on_event_event( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("event") sentry_sdk.get_isolation_scope().clear_breadcrumbs() with sentry_sdk.traces.start_span(name="custom parent"): @@ -518,7 +518,7 @@ def test_on_event_ignored( _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("span") sentry_sdk.get_isolation_scope().clear_breadcrumbs() with sentry_sdk.traces.start_span(name="custom parent"): @@ -578,7 +578,7 @@ def span_filter(metadata: Dict[str, object]) -> bool: _experiments={"trace_lifecycle": "stream" if span_streaming else "static"}, ) if span_streaming: - items = capture_items("event", "transaction", "span") + items = capture_items("span") with sentry_sdk.traces.start_span(name="custom parent"): original_sentry_span = sentry_sdk.traces.get_current_span()