Map<String, dynamic> toJson() => { 'scope': scope.toJson(), 'spans': spans.map((s) => s.toJson()).toList(), };