Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/otel/traces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,15 @@ fn flatten_span_record(span_record: &Span) -> Vec<Map<String, Value>> {
span_record_json.extend(flatten_status(status));
}

for span_json in &mut span_records_json {
for (key, value) in &span_record_json {
span_json.insert(key.clone(), value.clone());
// if span_record.events is null, code should still flatten other elements in the span record - this is handled in the if block
// else block handles the flattening the span record that includes events and links records in each span record
if span_records_json.is_empty() {
span_records_json = vec![span_record_json];
} else {
for span_json in &mut span_records_json {
for (key, value) in &span_record_json {
span_json.insert(key.clone(), value.clone());
}
}
}

Expand Down
Loading