@@ -302,10 +302,8 @@ async fn query_tempo_for_trace(
302
302
if let Ok ( tempo_response) =
303
303
serde_json:: from_str :: < TempoResponse > ( & response_text)
304
304
{
305
- if let Some ( batch) = tempo_response
306
- . batches
307
- . iter ( )
308
- . find ( |batch| {
305
+ if let Some ( batch) =
306
+ tempo_response. batches . iter ( ) . find ( |batch| {
309
307
batch. resource . attributes . iter ( ) . any ( |kv| {
310
308
kv. key == "service.name"
311
309
&& kv. value . string_value
@@ -315,8 +313,7 @@ async fn query_tempo_for_trace(
315
313
} )
316
314
} )
317
315
{
318
- if let Some ( scope_span) = batch. scope_spans . first ( )
319
- {
316
+ if let Some ( scope_span) = batch. scope_spans . first ( ) {
320
317
if scope_span. spans . iter ( ) . any ( |s| {
321
318
s. name == config. expected_span_name
322
319
&& s. kind == "SPAN_KIND_SERVER"
@@ -529,7 +526,7 @@ async fn test_root_endpoint_generates_telemetry() -> TestResult<()> {
529
526
let ( trace_id, http_client) = execute_traced_request ( & config) . await ?;
530
527
wait_for_trace_propagation ( & config) . await ;
531
528
532
- // Test all telemetry systems now that trace ID extraction works
529
+ // Test all telemetry systems
533
530
verify_telemetry_in_all_systems ( & http_client, & trace_id, & config) . await ?;
534
531
535
532
println ! ( "✅ Test completed successfully!" ) ;
@@ -639,23 +636,17 @@ async fn query_tempo_for_trace_with_error_status(
639
636
if let Ok ( tempo_response) =
640
637
serde_json:: from_str :: < TempoResponse > ( & response_text)
641
638
{
642
- if let Some ( batch) = tempo_response
643
- . batches
644
- . iter ( )
645
- . find ( |batch| {
646
- batch. resource . attributes . iter ( ) . any ( |kv| {
647
- kv. key == "service.name"
648
- && kv. value . string_value
649
- == Some ( config. expected_service_name . clone ( ) )
650
- } )
639
+ if let Some ( batch) = tempo_response. batches . iter ( ) . find ( |batch| {
640
+ batch. resource . attributes . iter ( ) . any ( |kv| {
641
+ kv. key == "service.name"
642
+ && kv. value . string_value
643
+ == Some ( config. expected_service_name . clone ( ) )
651
644
} )
652
- {
645
+ } ) {
653
646
if let Some ( scope_span) = batch. scope_spans . first ( ) {
654
- if scope_span
655
- . spans
656
- . iter ( )
657
- . any ( |s| s. status . code == Some ( "STATUS_CODE_ERROR" . to_string ( ) ) )
658
- {
647
+ if scope_span. spans . iter ( ) . any ( |s| {
648
+ s. status . code == Some ( "STATUS_CODE_ERROR" . to_string ( ) )
649
+ } ) {
659
650
println ! ( "Found trace with error status." ) ;
660
651
return Ok ( ( ) ) ;
661
652
}
0 commit comments