Map<String, dynamic> toJson() => { 'resourceSpans': resourceSpans.map((r) => r.toJson()).toList(), };