This package adds Phoenix
specific instrumentation on top of the new_relic_agent
package. You may use all the built-in capabilities of the New Relic Agent!
Check out the agent for more:
-
Install the Hex package
-
Cowboy 2 is required. Phoenix support was introduced in
1.4
def deps do
[
{:new_relic_phoenix, "~> 0.1"},
{:phoenix, "~> 1.4"},
{:plug_cowboy, "~> 2.0"}
]
end
- You must configure
new_relic_agent
to authenticate to New Relic. Please see: https://github.com/newrelic/elixir_agent/#configuration
- Inside your Phoenix Endpoint module,
use
theNewRelic.Phoenix.Transaction
module:
defmodule MyApp.Endpoint do
use Phoenix.Endpoint, otp_app: :my_app
use NewRelic.Phoenix.Transaction
# ...
end
- In your Phoenix Endpoint configuration, add the instrumenter:
config :my_app, MyApp.Endpoint,
instrumenters: [NewRelic.Phoenix.Instrumenter]