toJson method
Serializes trace event to a JSON map.
Implementation
Map<String, dynamic> toJson() => {
'id': id,
'method': method,
'url': url,
'headers': headers,
'body': body,
'timestamp': timestamp.toIso8601String(),
'statusCode': statusCode,
'responseBody': responseBody,
'latencyMs': latency?.inMilliseconds,
'error': error,
'isReplay': isReplay,
if (originalTraceId != null) 'originalTraceId': originalTraceId,
};