class Appsignal::Hooks::MongoMonitorSubscriber

def started(event)

Called by Mongo::Monitor when query starts
def started(event)
  transaction = Appsignal::Transaction.current
  return if transaction.nil_transaction?
  return if transaction.paused?
  # Format the command
  command = Appsignal::EventFormatter::MongoRubyDriver::QueryFormatter
    .format(event.command_name, event.command)
  # Store the query on the transaction, we need it when the event finishes
  store                   = transaction.store("mongo_driver")
  store[event.request_id] = command
  # Start this event
  transaction.start_event
end