Scout Elixir Installation¶
Tailored instructions are provided within our user interface. General instructions for a Phoenix 1.3+ app:
| 1 |
Add the `scout_apm` dependency: Your # mix.exs
def application do
[mod: {YourApp, []},
applications: [..., <span>:scout_apm</span>]]
end
def deps do
[{:phoenix, "~> 1.2.0"},
...
<span>{:scout_apm, "~> 0.0"}</span>]
end
Shell: mix deps.get
|
| 2 | Download your customized config file, placing it at Your customized config file is available within your Scout account. Inside the file, replace |
| 3 | Integrate into your Phoenix app. Instrument Controllers. In lib/your_app_web.ex: # lib/your_app_web.ex
defmodule YourApp.Web do
def controller do
quote do
use Phoenix.Controller
use ScoutApm.Instrumentation
...
Instrument Ecto queries. In config/config.exs: # config/config.exs
import_config "scout_apm.exs"
config :your_app, YourApp.Repo,
loggers: [{Ecto.LogEntry, :log, []},
{ScoutApm.Instruments.EctoLogger, :log, []}]
Instrument Templates. In config/config.exs: # config/config.exs
config :phoenix, :template_engines,
eex: ScoutApm.Instruments.EExEngine,
exs: ScoutApm.Instruments.ExsEngine
|
| 4 | Restart your app. mix phoenix.server
|