Imison is an error tracker that runs inside your Phoenix app. It captures the app's errors, groups them, stores them in the app's own Postgres database and serves a dashboard from the app's router. You don't need a separate service, an account or an API key.
This guide takes a Phoenix app from nothing to its first tracked error in about five minutes.

Requirements
- Elixir 1.20 or later
- A Phoenix app with LiveView (the
mix phx.newdefault), an Ecto repo on PostgreSQL and aPhoenix.PubSub - Optional: Swoosh, for email notifications (
mix phx.newincludes it) - Optional: Igniter, so the install task can edit your files for you
1. Add the dependency
# mix.exs
def deps do
[
{:imison, "~> 0.1"},
{:igniter, "~> 0.8", only: [:dev]}
]
endmix deps.get
2. Run the installer
mix imison.install
The task is an Igniter task, like mix oban.install. It shows each change and
asks before writing it. It skips any change that is already there, so you can
run it again safely. It makes these changes:
| File | Change |
|---|---|
config/config.exs | config :my_app, Imison with repo, pubsub and, when the app has MyApp.Mailer, mailer |
config/runtime.exs | In production, the dashboard login from IMISON_USER and IMISON_PASSWORD |
config/dev.exs | The login admin with a random password, generated at install time |
config/test.exs | enabled: false, so your tests record nothing |
lib/my_app/application.ex | {Imison, Application.fetch_env!(:my_app, Imison)} after the repo and PubSub |
priv/repo/migrations/*_add_imison.exs | A migration calling Imison.Migration.up(version: 1) |
lib/my_app_web/router.ex | import Imison.Web.Router and imison_dashboard "/errors" |
.formatter.exs | :imison in import_deps |
Without Igniter, mix imison.install changes no files. It prints the same
steps with your app's names filled in, for you to apply by hand. They are
listed under Installing by hand below.
3. Migrate
mix ecto.migrate
This creates Imison's tables, all prefixed imison_, in your database.
4. Open the dashboard
Start the app with mix phx.server and open http://localhost:4000/errors.
Sign in as admin with the password the installer wrote to
config/dev.exs.

5. Make an error
Raise anything in a controller:
def show(_conn, %{"id" => id}) do
raise ArgumentError, "invalid order id: #{inspect(id)}"
endRequest the page, and the error appears in the list within a second. You don't need to reload the page. Request it again and the error's count goes up instead of a second row appearing: occurrences with the same exception and the same place in your code are grouped into one error.
Production
In production, set the dashboard login through the environment:
IMISON_USER=ops IMISON_PASSWORD="a long random password" bin/my_app start
If either variable is missing, System.fetch_env!/1 in config/runtime.exs
raises and the app refuses to boot, so you can't deploy an open dashboard by
accident.
Next steps:
- Using the dashboard: triage errors, the list and the detail page
- Capturing errors: what is captured,
Imison.report/3and filtering - Notifications: email, Slack and webhooks
- Configuration: every option
Installing by hand
These are the steps mix imison.install performs. :my_app and MyApp
stand for your app's name and module prefix.
config/config.exs.pubsubis your endpoint'spubsub_server. Leave outmailerif the app doesn't send email through a Swoosh mailer.config :my_app, Imison, repo: MyApp.Repo, pubsub: MyApp.PubSub, mailer: MyApp.Mailerconfig/runtime.exs, insideif config_env() == :prod do:config :my_app, Imison, username: System.fetch_env!("IMISON_USER"), password: System.fetch_env!("IMISON_PASSWORD")config/dev.exs:config :my_app, Imison, username: "admin", password: "<a password you pick>"config/test.exs, so your tests record nothing:config :my_app, Imison, enabled: false, username: "test", password: "test"lib/my_app/application.ex, in the children list afterMyApp.Repoand thePhoenix.PubSubchild:{Imison, Application.fetch_env!(:my_app, Imison)}A migration. Generate it with
mix ecto.gen.migration add_imison, then fill it in:defmodule MyApp.Repo.Migrations.AddImison do use Ecto.Migration def up, do: Imison.Migration.up(version: 1) def down, do: Imison.Migration.down(version: 1) endlib/my_app_web/router.ex: import the macro afteruse MyAppWeb, :router, then mount the dashboard in a scope that pipes through:browser:import Imison.Web.Router scope "/" do pipe_through :browser imison_dashboard "/errors" end.formatter.exs, soimison_dashboardis formatted without parentheses:import_deps: [:imison, ...]
Then run mix ecto.migrate.
The :browser pipeline must call fetch_session and protect_from_forgery,
as the one mix phx.new generates does. Your endpoint also needs the LiveView
socket, with the session passed in connect_info:
socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]