|
20 | 20 | from asyncpg import connect, Connection |
21 | 21 | from freezegun import freeze_time |
22 | 22 |
|
23 | | -from sentry_sdk import capture_message, start_transaction |
| 23 | +from sentry_sdk import capture_message, start_span |
24 | 24 | from sentry_sdk.integrations.asyncpg import AsyncPGIntegration |
25 | 25 | from sentry_sdk.consts import SPANDATA |
26 | 26 | from sentry_sdk.tracing_utils import record_sql_queries |
@@ -498,7 +498,7 @@ async def test_query_source_disabled(sentry_init, capture_events): |
498 | 498 |
|
499 | 499 | events = capture_events() |
500 | 500 |
|
501 | | - with start_transaction(name="test_transaction", sampled=True): |
| 501 | + with start_span(name="test_span"): |
502 | 502 | conn: Connection = await connect(PG_CONNECTION_URI) |
503 | 503 |
|
504 | 504 | await conn.execute( |
@@ -537,7 +537,7 @@ async def test_query_source_enabled( |
537 | 537 |
|
538 | 538 | events = capture_events() |
539 | 539 |
|
540 | | - with start_transaction(name="test_transaction", sampled=True): |
| 540 | + with start_span(name="test_span"): |
541 | 541 | conn: Connection = await connect(PG_CONNECTION_URI) |
542 | 542 |
|
543 | 543 | await conn.execute( |
@@ -570,7 +570,7 @@ async def test_query_source(sentry_init, capture_events): |
570 | 570 |
|
571 | 571 | events = capture_events() |
572 | 572 |
|
573 | | - with start_transaction(name="test_transaction", sampled=True): |
| 573 | + with start_span(name="test_span"): |
574 | 574 | conn: Connection = await connect(PG_CONNECTION_URI) |
575 | 575 |
|
576 | 576 | await conn.execute( |
@@ -622,7 +622,7 @@ async def test_query_source_with_module_in_search_path(sentry_init, capture_even |
622 | 622 |
|
623 | 623 | from asyncpg_helpers.helpers import execute_query_in_connection |
624 | 624 |
|
625 | | - with start_transaction(name="test_transaction", sampled=True): |
| 625 | + with start_span(name="test_span"): |
626 | 626 | conn: Connection = await connect(PG_CONNECTION_URI) |
627 | 627 |
|
628 | 628 | await execute_query_in_connection( |
@@ -666,7 +666,7 @@ async def test_no_query_source_if_duration_too_short(sentry_init, capture_events |
666 | 666 |
|
667 | 667 | events = capture_events() |
668 | 668 |
|
669 | | - with start_transaction(name="test_transaction", sampled=True): |
| 669 | + with start_span(name="test_span"): |
670 | 670 | conn: Connection = await connect(PG_CONNECTION_URI) |
671 | 671 |
|
672 | 672 | @contextmanager |
@@ -716,7 +716,7 @@ async def test_query_source_if_duration_over_threshold(sentry_init, capture_even |
716 | 716 |
|
717 | 717 | events = capture_events() |
718 | 718 |
|
719 | | - with start_transaction(name="test_transaction", sampled=True): |
| 719 | + with start_span(name="test_span"): |
720 | 720 | conn: Connection = await connect(PG_CONNECTION_URI) |
721 | 721 |
|
722 | 722 | @contextmanager |
@@ -781,7 +781,7 @@ async def test_span_origin(sentry_init, capture_events): |
781 | 781 |
|
782 | 782 | events = capture_events() |
783 | 783 |
|
784 | | - with start_transaction(name="test_transaction"): |
| 784 | + with start_span(name="test_span"): |
785 | 785 | conn: Connection = await connect(PG_CONNECTION_URI) |
786 | 786 |
|
787 | 787 | await conn.execute("SELECT 1") |
|
0 commit comments