     Transaction.finish_event(transaction, name, title, body, body_format)
     result
   end
-
 end

  alias Appsignal.{Transaction, TransactionRegistry}

  @type instrument_arg :: Transaction.t | Plug.Conn.t | pid()

  @doc """
  Execute the given function in start / finish event calls. See `instrument/6`.

  import Appsignal.Instrumentation.Helpers, only: [instrument: 4]

  def index(conn, _params) do
    result = instrument "net.http", "Some slow backend call", fn() ->
      Backend.get_result()
    end
    json conn, result
