← All platforms

Phoenix error tracking

A request fails. A LiveView crashes. Keep something to investigate with the Sentry Phoenix integration and your own Telebugs server.

~/hoofnotes  nvim mix.exs config/config.exs lib/hoofnotes_web/endpoint.ex
defp deps do
[
{:phoenix, "~> 1.7.0"},
{:bandit, "~> 1.6"},
{:sentry, "~> 13.0"},
{:jason, "~> 1.4"},
{:finch, "~> 0.21"}
]
end
import Config
config :sentry,
# Copy the complete Telebugs DSN, key and path included.
dsn: "YOUR_TELEBUGS_DSN",
environment_name: config_env()
plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
pass: ["*/*"], json_decoder: Jason
plug Sentry.PlugContext
plug HoofnotesWeb.Router
~/hoofnotes  mix deps.get
~/hoofnotes  mix phx.server

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry. Point it at your Telebugs DSN and keep reporting errors as before. The reports go to your server; you don’t need a Sentry account.

Can I see which request failed?

Yes. The Phoenix integration can include request context with an exception and its Elixir backtrace. There are SDK integrations for both Bandit and Cowboy.

What about LiveView errors?

The SDK has a LiveView hook for reporting errors from LiveView processes. Those reports can go to the same Telebugs server as your request errors.

And the processes behind the scenes?

Use the SDK’s logger integration for OTP crash reports. Elixir errors don’t have to happen inside a web request to belong in Telebugs.