File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -293,9 +293,15 @@ fn flatten_span_record(span_record: &Span) -> Vec<Map<String, Value>> {
293
293
span_record_json. extend ( flatten_status ( status) ) ;
294
294
}
295
295
296
- for span_json in & mut span_records_json {
297
- for ( key, value) in & span_record_json {
298
- span_json. insert ( key. clone ( ) , value. clone ( ) ) ;
296
+ // if span_record.events is null, code should still flatten other elements in the span record - this is handled in the if block
297
+ // else block handles the flattening the span record that includes events and links records in each span record
298
+ if span_records_json. is_empty ( ) {
299
+ span_records_json = vec ! [ span_record_json] ;
300
+ } else {
301
+ for span_json in & mut span_records_json {
302
+ for ( key, value) in & span_record_json {
303
+ span_json. insert ( key. clone ( ) , value. clone ( ) ) ;
304
+ }
299
305
}
300
306
}
301
307
You can’t perform that action at this time.
0 commit comments