@@ -1527,71 +1527,6 @@ mod otel_integration_tests {
15271527 Ok ( ( ) )
15281528 }
15291529
1530- #[ test]
1531- fn wasi_otel_drop_semantics ( ) -> anyhow:: Result < ( ) > {
1532- let rt = tokio:: runtime:: Runtime :: new ( ) ?;
1533- let mut collector = rt
1534- . block_on ( FakeCollectorServer :: start ( ) )
1535- . expect ( "fake collector server should start" ) ;
1536- let collector_endpoint = collector. endpoint ( ) . clone ( ) ;
1537-
1538- run_test_inited (
1539- "wasi-otel-tracing" ,
1540- SpinConfig {
1541- binary_path : spin_binary ( ) ,
1542- spin_up_args : Vec :: new ( ) ,
1543- app_type : SpinAppType :: Http ,
1544- } ,
1545- ServicesConfig :: none ( ) ,
1546- |env| {
1547- env. set_env_var ( "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" , collector_endpoint) ;
1548- env. set_env_var ( "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL" , "grpc" ) ;
1549- env. set_env_var ( "OTEL_BSP_SCHEDULE_DELAY" , "5" ) ;
1550- Ok ( ( ) )
1551- } ,
1552- move |env| {
1553- let spin = env. runtime_mut ( ) ;
1554- assert_spin_request (
1555- spin,
1556- Request :: new ( Method :: Get , "/drop-semantics" ) ,
1557- Response :: new ( 200 ) ,
1558- ) ?;
1559-
1560- let spans = rt. block_on ( collector. exported_spans ( 3 , Duration :: from_secs ( 5 ) ) ) ;
1561-
1562- assert_eq ! ( spans. len( ) , 3 ) ;
1563-
1564- let handle_request_span = spans
1565- . iter ( )
1566- . find ( |s| s. name == "GET /..." )
1567- . expect ( "'GET /...' span should exist" ) ;
1568- let exec_component_span = spans
1569- . iter ( )
1570- . find ( |s| s. name == "execute_wasm_component wasi-otel-tracing" )
1571- . expect ( "'execute_wasm_component wasi-otel-tracing' span should exist" ) ;
1572- let drop_span = spans
1573- . iter ( )
1574- . find ( |s| s. name == "drop_semantics" )
1575- . expect ( "'drop_semantics' span should exist" ) ;
1576-
1577- assert ! (
1578- handle_request_span. trace_id == exec_component_span. trace_id
1579- && exec_component_span. trace_id == drop_span. trace_id
1580- ) ;
1581- assert_eq ! (
1582- exec_component_span. parent_span_id,
1583- handle_request_span. span_id
1584- ) ;
1585- assert_eq ! ( drop_span. parent_span_id, exec_component_span. span_id) ;
1586- assert ! ( drop_span. end_time_unix_nano < exec_component_span. end_time_unix_nano) ;
1587-
1588- Ok ( ( ) )
1589- } ,
1590- ) ?;
1591-
1592- Ok ( ( ) )
1593- }
1594-
15951530 #[ test]
15961531 fn wasi_otel_setting_attributes ( ) -> anyhow:: Result < ( ) > {
15971532 let rt = tokio:: runtime:: Runtime :: new ( ) ?;
@@ -1839,63 +1774,6 @@ mod otel_integration_tests {
18391774 Ok ( ( ) )
18401775 }
18411776
1842- #[ test]
1843- fn wasi_otel_child_outlives_parent ( ) -> anyhow:: Result < ( ) > {
1844- let rt = tokio:: runtime:: Runtime :: new ( ) ?;
1845- let mut collector = rt
1846- . block_on ( FakeCollectorServer :: start ( ) )
1847- . expect ( "fake collector server should start" ) ;
1848- let collector_endpoint = collector. endpoint ( ) . clone ( ) ;
1849-
1850- run_test_inited (
1851- "wasi-otel-tracing" ,
1852- SpinConfig {
1853- binary_path : spin_binary ( ) ,
1854- spin_up_args : Vec :: new ( ) ,
1855- app_type : SpinAppType :: Http ,
1856- } ,
1857- ServicesConfig :: none ( ) ,
1858- |env| {
1859- env. set_env_var ( "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" , collector_endpoint) ;
1860- env. set_env_var ( "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL" , "grpc" ) ;
1861- env. set_env_var ( "OTEL_BSP_SCHEDULE_DELAY" , "5" ) ;
1862- Ok ( ( ) )
1863- } ,
1864- move |env| {
1865- let spin = env. runtime_mut ( ) ;
1866- assert_spin_request (
1867- spin,
1868- Request :: new ( Method :: Get , "/child-outlives-parent" ) ,
1869- Response :: new ( 200 ) ,
1870- ) ?;
1871-
1872- let spans = rt. block_on ( collector. exported_spans ( 5 , Duration :: from_secs ( 5 ) ) ) ;
1873-
1874- assert_eq ! ( spans. len( ) , 5 ) ;
1875-
1876- let parent_span = spans
1877- . iter ( )
1878- . find ( |s| s. name == "parent" )
1879- . expect ( "'parent' span should exist" ) ;
1880- let child_span = spans
1881- . iter ( )
1882- . find ( |s| s. name == "child" )
1883- . expect ( "'child' span should exist" ) ;
1884- let get_span = spans
1885- . iter ( )
1886- . find ( |s| s. name == "GET" )
1887- . expect ( "'GET' span should exist" ) ;
1888- assert_eq ! ( child_span. parent_span_id, parent_span. span_id) ;
1889- assert_eq ! ( get_span. parent_span_id, child_span. span_id) ;
1890- assert ! ( child_span. end_time_unix_nano > parent_span. end_time_unix_nano) ;
1891-
1892- Ok ( ( ) )
1893- } ,
1894- ) ?;
1895-
1896- Ok ( ( ) )
1897- }
1898-
18991777 #[ test]
19001778 fn wasi_otel_root_span ( ) -> anyhow:: Result < ( ) > {
19011779 let rt = tokio:: runtime:: Runtime :: new ( ) ?;
@@ -1928,38 +1806,20 @@ mod otel_integration_tests {
19281806
19291807 let spans = rt. block_on ( collector. exported_spans ( 7 , Duration :: from_secs ( 5 ) ) ) ;
19301808
1931- assert_eq ! ( spans. len( ) , 7 ) ;
1809+ assert_eq ! ( spans. len( ) , 4 ) ;
19321810
1933- let parent_span = spans
1934- . iter ( )
1935- . find ( |s| s. name == "parent" )
1936- . expect ( "'parent' span should exist" ) ;
1937- let request_one = spans
1938- . iter ( )
1939- . find ( |s| s. name == "GET" )
1940- . expect ( "first 'GET' span should exist" ) ;
19411811 let root_span = spans
19421812 . iter ( )
19431813 . find ( |s| s. name == "root" )
19441814 . expect ( "'root' span should exist" ) ;
1945- let request_two = spans
1946- . iter ( )
1947- . filter ( |s| s. name == "GET" )
1948- . nth ( 1 )
1949- . expect ( "second 'GET' span should exist" ) ;
1950- let request_three = spans
1815+ let request_span = spans
19511816 . iter ( )
1952- . filter ( |s| s. name == "GET" )
1953- . nth ( 2 )
1954- . expect ( "third 'GET' span should exist" ) ;
1955-
1956- assert_eq ! ( parent_span. trace_id, request_one. trace_id) ;
1957- assert_ne ! ( root_span. trace_id, parent_span. trace_id) ;
1958- assert_eq ! ( root_span. trace_id, request_two. trace_id) ;
1959- assert_eq ! ( parent_span. trace_id, request_three. trace_id) ;
1817+ . find ( |s| s. name == "GET" )
1818+ . expect ( "'GET' span should exist" ) ;
1819+
1820+ assert_eq ! ( root_span. trace_id, request_span. trace_id) ;
1821+ assert_eq ! ( root_span. span_id, request_span. parent_span_id) ;
19601822 assert_eq ! ( root_span. parent_span_id, "" . to_string( ) ) ;
1961- assert_eq ! ( request_two. parent_span_id, root_span. span_id) ;
1962- assert_ne ! ( request_three. parent_span_id, parent_span. span_id) ;
19631823
19641824 Ok ( ( ) )
19651825 } ,
0 commit comments