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.8"}]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 douse MyApp.Web, :routerpipeline :api doplug :accepts, ["json"]plug PerfAgent.Plug.Phoenixendscope "/api/v1", MyApp dopipe_through :apiendend- In this example we've added it to an API pipeline