toMap method

  1. @override
Map<String, dynamic> toMap()
override

Converts the event to a map with New Relic-specific formatting

Implementation

@override
Map<String, dynamic> toMap() {
  final map = super.toMap();

  if (attributes != null && attributes!.isNotEmpty) {
    map['attributes'] = attributes;
  }

  if (entityName != null) {
    map['entityName'] = entityName;
  }

  if (entityType != null) {
    map['entityType'] = entityType;
  }

  if (host != null) {
    map['host'] = host;
  }

  if (environment != null) {
    map['environment'] = environment;
  }

  if (traceId != null) {
    map['traceId'] = traceId;
  }

  if (spanId != null) {
    map['spanId'] = spanId;
  }

  return map;
}