function maybeAddExternalAttributes(transaction, attributes) {
  const metric = transaction.metrics.getMetric(NAMES.EXTERNAL.ALL)

  if (metric) {
    attributes.externalDuration = metric.total
    attributes.externalCallCount = metric.callCount
  }
}
Helper method for modifying attributes by reference if transaction has external call metrics

@param {object} transaction The current transaction
@param {object} attributes The attributes object to modify (by reference)