New Relixir v0.5.0 NewRelixir.Instrumenters.Phoenix View Source
New Relic instrumenter for Phoenix controllers.
It relies on the instrumentation API provided by Phoenix.Endpoint
. To set it up,
include this module in the list of instrumenters
of your Endpoint config:
config :my_app, MyAppWeb.Endpoint,
instrumenters: [NewRelixir.Instrumenters.Phoenix],
Transaction traces will be composed of both controller and action names, e.g.
/HomeController#index
, /ProfileController#update
.
Link to this section Summary
Functions
If first argument is the atom :start
this is used as the Start callback for
Phoenix controllers. Phoenix calls it once a request is routed, before
processing a controller action.
Returns the transaction name, formatted as Controller#action
. This value is
stored and passed along as the third argument to the :stop
callback
Link to this section Functions
phoenix_controller_call(:start, %{}, %Plug.Conn{ adapter: term(), assigns: term(), before_send: term(), body_params: term(), cookies: term(), halted: term(), host: term(), method: term(), owner: term(), params: term(), path_info: term(), path_params: term(), peer: term(), port: term(), private: term(), query_params: term(), query_string: term(), remote_ip: term(), req_cookies: term(), req_headers: term(), request_path: term(), resp_body: term(), resp_cookies: term(), resp_headers: term(), scheme: term(), script_name: term(), secret_key_base: term(), state: term(), status: term() }) :: transaction :: binary()
phoenix_controller_call(:stop, integer(), transaction :: binary()) :: :ok | nil
If first argument is the atom :start
this is used as the Start callback for
Phoenix controllers. Phoenix calls it once a request is routed, before
processing a controller action.
Returns the transaction name, formatted as Controller#action
. This value is
stored and passed along as the third argument to the :stop
callback.
When called with the atom :stop
this is used as the Stop callback for
Phoenix controllers. Phoenix calls it after the whole controller pipeline
finishes executing the routed action. You should additionally provide the
elapsed_time and the Transaction as the second and third arguments.