@@ -155,7 +155,7 @@ async def test_aiohttp_request_body_data_collection(
155155):
156156 sentry_init (
157157 integrations = [AioHttpIntegration ()],
158- _experiments = { " data_collection" : data_collection } ,
158+ data_collection = data_collection ,
159159 )
160160
161161 body = {"some" : "value" }
@@ -207,7 +207,7 @@ async def test_aiohttp_oversized_request_body_data_collection(
207207 sentry_init (
208208 integrations = [AioHttpIntegration ()],
209209 max_request_body_size = "small" ,
210- _experiments = { " data_collection" : data_collection } ,
210+ data_collection = data_collection ,
211211 )
212212
213213 body = "a" * 2000
@@ -643,21 +643,17 @@ async def handler(request):
643643 ({"send_default_pii" : False }, False , False ),
644644 (
645645 {
646- "_experiments" : {
647- "data_collection" : {
648- "url_query_params" : {"mode" : "denylist" , "terms" : []}
649- }
646+ "data_collection" : {
647+ "url_query_params" : {"mode" : "denylist" , "terms" : []}
650648 }
651649 },
652650 True ,
653651 True ,
654652 ),
655653 (
656654 {
657- "_experiments" : {
658- "data_collection" : {
659- "url_query_params" : {"mode" : "allowlist" , "terms" : []}
660- }
655+ "data_collection" : {
656+ "url_query_params" : {"mode" : "allowlist" , "terms" : []}
661657 }
662658 },
663659 True ,
@@ -794,21 +790,17 @@ async def handler(request):
794790 ({"send_default_pii" : False }, False , False ),
795791 (
796792 {
797- "_experiments" : {
798- "data_collection" : {
799- "url_query_params" : {"mode" : "denylist" , "terms" : []}
800- }
793+ "data_collection" : {
794+ "url_query_params" : {"mode" : "denylist" , "terms" : []}
801795 }
802796 },
803797 True ,
804798 True ,
805799 ),
806800 (
807801 {
808- "_experiments" : {
809- "data_collection" : {
810- "url_query_params" : {"mode" : "allowlist" , "terms" : []}
811- }
802+ "data_collection" : {
803+ "url_query_params" : {"mode" : "allowlist" , "terms" : []}
812804 }
813805 },
814806 True ,
@@ -1678,7 +1670,7 @@ async def hello(request):
16781670 pytest .param (
16791671 {
16801672 "send_default_pii" : True ,
1681- "data_collection" : None ,
1673+ "data_collection" : {} ,
16821674 },
16831675 {
16841676 "authorization" : "[Filtered]" ,
@@ -1690,7 +1682,7 @@ async def hello(request):
16901682 pytest .param (
16911683 {
16921684 "send_default_pii" : False ,
1693- "data_collection" : None ,
1685+ "data_collection" : {} ,
16941686 },
16951687 {
16961688 "authorization" : "[Filtered]" ,
@@ -1794,9 +1786,7 @@ async def test_sensitive_header_passthrough_with_pii_span_streaming(
17941786 traces_sample_rate = 1.0 ,
17951787 send_default_pii = options ["send_default_pii" ],
17961788 trace_lifecycle = "stream" ,
1797- _experiments = {
1798- "data_collection" : options ["data_collection" ],
1799- },
1789+ data_collection = options ["data_collection" ],
18001790 )
18011791
18021792 async def hello (request ):
@@ -2256,52 +2246,46 @@ async def hello(request):
22562246 id = "defaults" ,
22572247 ),
22582248 pytest .param (
2259- {"_experiments" : { " data_collection" : {} }},
2249+ {"data_collection" : {}},
22602250 "toy=tennisball&color=red&auth=%5BFiltered%5D" ,
22612251 id = "data_collection_denylist_default" ,
22622252 ),
22632253 pytest .param (
22642254 {
2265- "_experiments" : {
2266- "data_collection" : {
2267- "url_query_params" : {"mode" : "denylist" , "terms" : ["toy" ]}
2268- }
2255+ "data_collection" : {
2256+ "url_query_params" : {"mode" : "denylist" , "terms" : ["toy" ]}
22692257 }
22702258 },
22712259 "toy=%5BFiltered%5D&color=red&auth=%5BFiltered%5D" ,
22722260 id = "data_collection_denylist_custom_terms" ,
22732261 ),
22742262 pytest .param (
22752263 {
2276- "_experiments" : {
2277- "data_collection" : {
2278- "url_query_params" : {"mode" : "allowlist" , "terms" : ["toy" ]}
2279- }
2264+ "data_collection" : {
2265+ "url_query_params" : {"mode" : "allowlist" , "terms" : ["toy" ]}
22802266 }
22812267 },
22822268 "toy=tennisball&color=%5BFiltered%5D&auth=%5BFiltered%5D" ,
22832269 id = "data_collection_allowlist" ,
22842270 ),
22852271 pytest .param (
22862272 {
2287- "_experiments" : {
2288- "data_collection" : {
2289- "url_query_params" : {"mode" : "allowlist" , "terms" : ["auth" ]}
2290- }
2273+ "data_collection" : {
2274+ "url_query_params" : {"mode" : "allowlist" , "terms" : ["auth" ]}
22912275 }
22922276 },
22932277 "toy=%5BFiltered%5D&color=%5BFiltered%5D&auth=%5BFiltered%5D" ,
22942278 id = "data_collection_allowlist_sensitive_term" ,
22952279 ),
22962280 pytest .param (
2297- {"_experiments" : { " data_collection" : {"url_query_params" : {"mode" : "off" } }}},
2281+ {"data_collection" : {"url_query_params" : {"mode" : "off" }}},
22982282 None ,
22992283 id = "data_collection_off" ,
23002284 ),
23012285 pytest .param (
23022286 {
23032287 "send_default_pii" : True ,
2304- "_experiments" : { " data_collection" : {"url_query_params" : {"mode" : "off" } }},
2288+ "data_collection" : {"url_query_params" : {"mode" : "off" }},
23052289 },
23062290 None ,
23072291 id = "data_collection_wins_over_send_default_pii" ,
@@ -2422,7 +2406,7 @@ async def hello(request):
24222406 assert event ["request" ]["url" ] == "http://{host}/" .format (host = host )
24232407 assert event ["request" ]["method" ] == "GET"
24242408
2425- if "data_collection" not in init_kwargs . get ( "_experiments" , {}) :
2409+ if "data_collection" not in init_kwargs :
24262410 assert (
24272411 event ["request" ]["query_string" ] == "toy=tennisball&color=red&auth=secret"
24282412 )
0 commit comments