diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 0095cafab7..da1965f757 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -11,6 +11,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh - The SDK now supports Python 3.7 and higher. - `sentry_sdk.start_span` now only takes keyword arguments. - `sentry_sdk.start_span` no longer takes an explicit `span` argument. +- `sentry_sdk.start_span` no longer takes explicit `trace_id`, `span_id` or `parent_span_id` arguments. - The `Span()` constructor does not accept a `hub` parameter anymore. - `Span.finish()` does not accept a `hub` parameter anymore. - The `Profile()` constructor does not accept a `hub` parameter anymore. diff --git a/tests/integrations/aiohttp/test_aiohttp.py b/tests/integrations/aiohttp/test_aiohttp.py index bafb639c34..432427b08e 100644 --- a/tests/integrations/aiohttp/test_aiohttp.py +++ b/tests/integrations/aiohttp/test_aiohttp.py @@ -535,8 +535,6 @@ async def handler(request): with start_transaction( name="/interactions/other-dogs/new-dog", op="greeting.sniff", - # make trace_id difference between transactions - trace_id="0123456789012345678901234567890", ) as transaction: client = await aiohttp_client(raw_server) resp = await client.get("/") @@ -572,14 +570,21 @@ async def handler(request): with start_transaction( name="/interactions/other-dogs/new-dog", op="greeting.sniff", - trace_id="0123456789012345678901234567890", - ): + ) as transaction: client = await aiohttp_client(raw_server) resp = await client.get("/", headers={"bagGage": "custom=value"}) assert ( - resp.request_info.headers["baggage"] - == "custom=value,sentry-trace_id=0123456789012345678901234567890,sentry-environment=production,sentry-release=d08ebdb9309e1b004c6f52202de58a09c2268e42,sentry-transaction=/interactions/other-dogs/new-dog,sentry-sample_rate=1.0,sentry-sampled=true" + sorted(resp.request_info.headers["baggage"].split(",")) + == sorted([ + "custom=value", + f"sentry-trace_id={transaction.trace_id}", + "sentry-environment=production", + "sentry-release=d08ebdb9309e1b004c6f52202de58a09c2268e42", + "sentry-transaction=/interactions/other-dogs/new-dog", + "sentry-sample_rate=1.0", + "sentry-sampled=true", + ]) )