New Relic Elixir Agent v1.4.0 NewRelic.Transaction View Source

Transaction Reporting

To enable Transaction reporting, you must instrument your Plug pipeline with a single line. The NewRelic.Transaction macro injects the required plugs to wire up automatic Transaction reporting.

Be sure to use this as early in your Plug pipeline as possible to ensure the most accurate response times.

defmodule MyApp do
  use Plug.Router
  use NewRelic.Transaction
  # ...
end

Link to this section Summary

Functions

If you send a custom error response in your own Plug.ErrorHandler, you MUST manually alert the agent of the error!

Link to this section Functions

Link to this function handle_errors(conn, error) View Source

If you send a custom error response in your own Plug.ErrorHandler, you MUST manually alert the agent of the error!

defmodule MyPlug do
  # ...
  use Plug.ErrorHandler
  def handle_errors(conn, error) do
    NewRelic.Transaction.handle_errors(conn, error)
    send_resp(conn, 500, "Oops!")
  end
end