PerfAgent
perf_agent is a plug that will record timing and status codes of the connections in the Phoenix framework and send the data to Perf. We then run analytics on that data to generate metrics and alerts.
Right now perf is in private beta but if you're interested in an API key, feel free to email us at hi@perf.sh
Installation
Add the agent to your list of dependencies in
mix.exsvia Hexdef deps do [{:perf_agent, "~> 0.1.7"}] end-
Run
mix deps.getin your Terminal to install all dependencies
-
Run
Ensure
perf_agentis started before your applicationdef application do [applications: [:perf_agent]] endAdd your Perf API Key to your
config.exsconfig :perf_agent, api_key: "PERF_API_KEY"Add the plug to a pipeline in your router
defmodule MyApp.Router do use MyApp.Web, :router pipeline :api do plug :accepts, ["json"] plug PerfAgent.Plug.Phoenix end scope "/api/v1", MyApp do pipe_through :api end end- In this example we've added it to an API pipeline