@@ -187,6 +187,8 @@ def test_path_param(client: TestClient, exporter: TestExporter) -> None:
187187 assert response .status_code == 200
188188 assert response .json () == {'param' : 'param_val' }
189189
190+ assert exporter .exported_spans [1 ].instrumentation_scope .name == 'logfire.fastapi' # type: ignore
191+
190192 span_dicts = exporter .exported_spans_as_dict (_include_pending_spans = True )
191193
192194 # Highlights of the below mega-assert:
@@ -242,7 +244,6 @@ def test_path_param(client: TestClient, exporter: TestExporter) -> None:
242244 'logfire.msg' : 'FastAPI arguments' ,
243245 'logfire.span_type' : 'pending_span' ,
244246 'logfire.pending_parent_id' : '0000000000000001' ,
245- 'logfire.tags' : ('fastapi' ,),
246247 },
247248 },
248249 {
@@ -255,7 +256,6 @@ def test_path_param(client: TestClient, exporter: TestExporter) -> None:
255256 'logfire.msg_template' : 'FastAPI arguments' ,
256257 'logfire.msg' : 'FastAPI arguments' ,
257258 'logfire.span_type' : 'span' ,
258- 'logfire.tags' : ('fastapi' ,),
259259 'logfire.level_num' : 5 ,
260260 },
261261 },
@@ -274,7 +274,6 @@ def test_path_param(client: TestClient, exporter: TestExporter) -> None:
274274 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
275275 'logfire.span_type' : 'pending_span' ,
276276 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
277- 'logfire.tags' : ('fastapi' ,),
278277 'logfire.msg' : 'GET /with_path_param/{param} (with_path_param)' ,
279278 'logfire.level_num' : 5 ,
280279 'logfire.pending_parent_id' : '0000000000000001' ,
@@ -295,7 +294,6 @@ def test_path_param(client: TestClient, exporter: TestExporter) -> None:
295294 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
296295 'logfire.span_type' : 'span' ,
297296 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
298- 'logfire.tags' : ('fastapi' ,),
299297 'logfire.msg' : 'GET /with_path_param/{param} (with_path_param)' ,
300298 'logfire.level_num' : 5 ,
301299 },
@@ -461,7 +459,6 @@ def test_fastapi_instrumentation(client: TestClient, exporter: TestExporter) ->
461459 'logfire.msg' : 'FastAPI arguments' ,
462460 'logfire.span_type' : 'pending_span' ,
463461 'logfire.pending_parent_id' : '0000000000000003' ,
464- 'logfire.tags' : ('fastapi' ,),
465462 },
466463 },
467464 {
@@ -472,7 +469,6 @@ def test_fastapi_instrumentation(client: TestClient, exporter: TestExporter) ->
472469 'end_time' : 4000000000 ,
473470 'attributes' : {
474471 'logfire.span_type' : 'span' ,
475- 'logfire.tags' : ('fastapi' ,),
476472 'logfire.msg_template' : 'FastAPI arguments' ,
477473 'logfire.msg' : 'FastAPI arguments' ,
478474 'logfire.level_num' : 5 ,
@@ -494,7 +490,6 @@ def test_fastapi_instrumentation(client: TestClient, exporter: TestExporter) ->
494490 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
495491 'logfire.span_type' : 'pending_span' ,
496492 'logfire.msg' : 'GET / (homepage)' ,
497- 'logfire.tags' : ('fastapi' ,),
498493 'logfire.level_num' : 5 ,
499494 'logfire.pending_parent_id' : '0000000000000003' ,
500495 },
@@ -530,7 +525,6 @@ def test_fastapi_instrumentation(client: TestClient, exporter: TestExporter) ->
530525 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
531526 'logfire.span_type' : 'span' ,
532527 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
533- 'logfire.tags' : ('fastapi' ,),
534528 'logfire.msg' : 'GET / (homepage)' ,
535529 'logfire.level_num' : 5 ,
536530 },
@@ -684,7 +678,6 @@ def test_fastapi_arguments(client: TestClient, exporter: TestExporter) -> None:
684678 },
685679 }
686680 ),
687- 'logfire.tags' : ('fastapi' ,),
688681 },
689682 },
690683 {
@@ -791,7 +784,6 @@ def test_get_fastapi_arguments(client: TestClient, exporter: TestExporter) -> No
791784 },
792785 }
793786 ),
794- 'logfire.tags' : ('fastapi' ,),
795787 },
796788 },
797789 {
@@ -809,7 +801,6 @@ def test_get_fastapi_arguments(client: TestClient, exporter: TestExporter) -> No
809801 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
810802 'logfire.msg' : 'GET /other (other_route)' ,
811803 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
812- 'logfire.tags' : ('fastapi' ,),
813804 'logfire.level_num' : 5 ,
814805 'logfire.span_type' : 'span' ,
815806 },
@@ -918,7 +909,6 @@ def test_first_lvl_subapp_fastapi_arguments(client: TestClient, exporter: TestEx
918909 },
919910 }
920911 ),
921- 'logfire.tags' : ('fastapi' ,),
922912 },
923913 },
924914 {
@@ -936,7 +926,6 @@ def test_first_lvl_subapp_fastapi_arguments(client: TestClient, exporter: TestEx
936926 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
937927 'logfire.msg' : 'GET /other (other_route)' ,
938928 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
939- 'logfire.tags' : ('fastapi' ,),
940929 'logfire.level_num' : 5 ,
941930 'logfire.span_type' : 'span' ,
942931 },
@@ -1045,7 +1034,6 @@ def test_second_lvl_subapp_fastapi_arguments(client: TestClient, exporter: TestE
10451034 },
10461035 }
10471036 ),
1048- 'logfire.tags' : ('fastapi' ,),
10491037 },
10501038 },
10511039 {
@@ -1063,7 +1051,6 @@ def test_second_lvl_subapp_fastapi_arguments(client: TestClient, exporter: TestE
10631051 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
10641052 'logfire.msg' : 'GET /other (other_route)' ,
10651053 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
1066- 'logfire.tags' : ('fastapi' ,),
10671054 'logfire.level_num' : 5 ,
10681055 'logfire.span_type' : 'span' ,
10691056 },
@@ -1149,7 +1136,6 @@ def test_fastapi_unhandled_exception(client: TestClient, exporter: TestExporter)
11491136 'attributes' : {
11501137 'logfire.msg_template' : 'FastAPI arguments' ,
11511138 'logfire.msg' : 'FastAPI arguments' ,
1152- 'logfire.tags' : ('fastapi' ,),
11531139 'logfire.span_type' : 'span' ,
11541140 'logfire.level_num' : 5 ,
11551141 },
@@ -1169,7 +1155,6 @@ def test_fastapi_unhandled_exception(client: TestClient, exporter: TestExporter)
11691155 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
11701156 'logfire.msg' : 'GET /exception (exception)' ,
11711157 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
1172- 'logfire.tags' : ('fastapi' ,),
11731158 'logfire.span_type' : 'span' ,
11741159 'logfire.level_num' : 17 ,
11751160 },
@@ -1251,7 +1236,6 @@ def test_fastapi_handled_exception(client: TestClient, exporter: TestExporter) -
12511236 'attributes' : {
12521237 'logfire.msg_template' : 'FastAPI arguments' ,
12531238 'logfire.msg' : 'FastAPI arguments' ,
1254- 'logfire.tags' : ('fastapi' ,),
12551239 'logfire.span_type' : 'span' ,
12561240 'logfire.level_num' : 5 ,
12571241 },
@@ -1271,7 +1255,6 @@ def test_fastapi_handled_exception(client: TestClient, exporter: TestExporter) -
12711255 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
12721256 'logfire.msg' : 'GET /validation_error (validation_error)' ,
12731257 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
1274- 'logfire.tags' : ('fastapi' ,),
12751258 'logfire.span_type' : 'span' ,
12761259 'logfire.level_num' : 17 ,
12771260 },
@@ -1390,7 +1373,6 @@ def test_scrubbing(client: TestClient, exporter: TestExporter) -> None:
13901373 'fastapi.route.name' : 'secret' ,
13911374 'logfire.null_args' : ('fastapi.route.operation_id' ,),
13921375 'logfire.json_schema' : '{"type":"object","properties":{"values":{"type":"object"},"errors":{"type":"array"},"custom_attr":{},"http.method":{},"http.route":{},"fastapi.route.name":{},"fastapi.route.operation_id":{}}}' ,
1393- 'logfire.tags' : ('fastapi' ,),
13941376 'logfire.scrubbed' : IsJson (
13951377 [
13961378 {'path' : ['attributes' , 'values' , 'path_param' ], 'matched_substring' : 'auth' },
@@ -1415,7 +1397,6 @@ def test_scrubbing(client: TestClient, exporter: TestExporter) -> None:
14151397 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
14161398 'logfire.msg' : 'GET /secret/{path_param} (get_secret)' ,
14171399 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
1418- 'logfire.tags' : ('fastapi' ,),
14191400 'logfire.level_num' : 5 ,
14201401 'logfire.span_type' : 'span' ,
14211402 },
@@ -1541,7 +1522,6 @@ def test_request_hooks_without_send_receiev_spans(exporter: TestExporter):
15411522 'attributes' : {
15421523 'logfire.msg_template' : 'FastAPI arguments' ,
15431524 'logfire.msg' : 'FastAPI arguments' ,
1544- 'logfire.tags' : ('fastapi' ,),
15451525 'logfire.span_type' : 'span' ,
15461526 'values' : '{}' ,
15471527 'errors' : '[]' ,
@@ -1583,7 +1563,6 @@ def test_request_hooks_without_send_receiev_spans(exporter: TestExporter):
15831563 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
15841564 'logfire.msg' : 'POST /echo_body (echo_body)' ,
15851565 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
1586- 'logfire.tags' : ('fastapi' ,),
15871566 'logfire.level_num' : 5 ,
15881567 'logfire.span_type' : 'span' ,
15891568 },
@@ -1686,7 +1665,6 @@ def test_request_hooks_with_send_receive_spans(exporter: TestExporter):
16861665 'attributes' : {
16871666 'logfire.msg_template' : 'FastAPI arguments' ,
16881667 'logfire.msg' : 'FastAPI arguments' ,
1689- 'logfire.tags' : ('fastapi' ,),
16901668 'logfire.span_type' : 'span' ,
16911669 'values' : '{}' ,
16921670 'errors' : '[]' ,
@@ -1741,7 +1719,6 @@ def test_request_hooks_with_send_receive_spans(exporter: TestExporter):
17411719 'logfire.msg_template' : '{method} {http.route} ({code.function})' ,
17421720 'logfire.msg' : 'POST /echo_body (echo_body)' ,
17431721 'logfire.json_schema' : '{"type":"object","properties":{"method":{},"http.route":{}}}' ,
1744- 'logfire.tags' : ('fastapi' ,),
17451722 'logfire.level_num' : 5 ,
17461723 'logfire.span_type' : 'span' ,
17471724 },
0 commit comments