@@ -42,7 +42,7 @@ async def __call__(self, *args, **kwargs):
4242except ImportError :
4343 from anthropic .types .content_block import ContentBlock as TextBlock
4444
45- from sentry_sdk import start_transaction
45+ from sentry_sdk import start_span
4646from sentry_sdk .consts import OP , SPANDATA
4747from sentry_sdk .integrations .anthropic import AnthropicIntegration
4848
@@ -90,7 +90,7 @@ def test_nonstreaming_create_message(
9090 }
9191 ]
9292
93- with start_transaction (name = "anthropic" ):
93+ with start_span (name = "anthropic" ):
9494 response = client .messages .create (
9595 max_tokens = 1024 , messages = messages , model = "model"
9696 )
@@ -160,7 +160,7 @@ async def test_nonstreaming_create_message_async(
160160 }
161161 ]
162162
163- with start_transaction (name = "anthropic" ):
163+ with start_span (name = "anthropic" ):
164164 response = await client .messages .create (
165165 max_tokens = 1024 , messages = messages , model = "model"
166166 )
@@ -263,7 +263,7 @@ def test_streaming_create_message(
263263 }
264264 ]
265265
266- with start_transaction (name = "anthropic" ):
266+ with start_span (name = "anthropic" ):
267267 message = client .messages .create (
268268 max_tokens = 1024 , messages = messages , model = "model" , stream = True
269269 )
@@ -368,7 +368,7 @@ async def test_streaming_create_message_async(
368368 }
369369 ]
370370
371- with start_transaction (name = "anthropic" ):
371+ with start_span (name = "anthropic" ):
372372 message = await client .messages .create (
373373 max_tokens = 1024 , messages = messages , model = "model" , stream = True
374374 )
@@ -500,7 +500,7 @@ def test_streaming_create_message_with_input_json_delta(
500500 }
501501 ]
502502
503- with start_transaction (name = "anthropic" ):
503+ with start_span (name = "anthropic" ):
504504 message = client .messages .create (
505505 max_tokens = 1024 , messages = messages , model = "model" , stream = True
506506 )
@@ -639,7 +639,7 @@ async def test_streaming_create_message_with_input_json_delta_async(
639639 }
640640 ]
641641
642- with start_transaction (name = "anthropic" ):
642+ with start_span (name = "anthropic" ):
643643 message = await client .messages .create (
644644 max_tokens = 1024 , messages = messages , model = "model" , stream = True
645645 )
@@ -736,7 +736,7 @@ def test_span_origin(sentry_init, capture_events):
736736 }
737737 ]
738738
739- with start_transaction (name = "anthropic" ):
739+ with start_span (name = "anthropic" ):
740740 client .messages .create (max_tokens = 1024 , messages = messages , model = "model" )
741741
742742 (event ,) = events
@@ -763,7 +763,7 @@ async def test_span_origin_async(sentry_init, capture_events):
763763 }
764764 ]
765765
766- with start_transaction (name = "anthropic" ):
766+ with start_span (name = "anthropic" ):
767767 await client .messages .create (max_tokens = 1024 , messages = messages , model = "model" )
768768
769769 (event ,) = events
0 commit comments