function maybeAddDatabaseAttributes(transaction, attributes) {
  const metric = transaction.metrics.getMetric(NAMES.DB.ALL)

  if (metric) {
    attributes.databaseDuration = metric.total
    attributes.databaseCallCount = metric.callCount
  }
}
Helper method for modifying attributes by reference if transaction has database metrics

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