How to Monitor Your Elixir/Phoenix Application with Vigilmon (Complete Guide)
Elixir and Phoenix applications are known for their fault-tolerance and high concurrency. But even the most resilient BEAM-powered app can have downtime. This guide covers a complete monitoring strategy for Elixir/Phoenix using Vigilmon.
Why Phoenix Apps Need Dedicated Monitoring
Phoenix's supervisor trees and OTP process model handle many fault scenarios automatically — but they don't protect you from:
- Infrastructure-level outages (load balancers, DNS, CDN failures)
- External service dependencies (databases, third-party APIs)
- SSL certificate expiry
- Deployment regressions that survive supervisor restarts
- Silent failures in background jobs (Oban, GenServer workers)
Vigilmon gives you external visibility that complements Phoenix's internal fault-tolerance.
Setting Up HTTP Uptime Monitoring
For a typical Phoenix app running on Fly.io, Render, or a VPS:
- Log in to vigilmon.online
- Click Add Monitor → HTTP(S)
- Set your URL:
https://yourapp.fly.devor your custom domain - Interval: 60 seconds (recommended for production)
- Set up email alerts for your engineering team
Health Check Endpoint in Phoenix
Add a lightweight health check to your Phoenix router:
# lib/your_app_web/router.ex
scope "/health", YourAppWeb do
pipe_through :api
get "/", HealthController, :check
end
# lib/your_app_web/controllers/health_controller.ex
defmodule YourAppWeb.HealthController do
use YourAppWeb, :controller
def check(conn, _params) do
# Check DB connection
case YourApp.Repo.query("SELECT 1", []) do
{:ok, _} ->
json(conn, %{status: "ok", db: "connected"})
{:error, _} ->
conn
|> put_status(503)
|> json(%{status: "error", db: "disconnected"})
end
end
end
Monitor /health in Vigilmon for a real-world health signal that tests your DB connection.
Monitoring Oban Background Jobs
Oban is the standard Phoenix background job library. Add a heartbeat job that pings Vigilmon:
# lib/your_app/workers/heartbeat_worker.ex
defmodule YourApp.Workers.HeartbeatWorker do
use Oban.Worker, queue: :default, max_attempts: 1
@vigilmon_heartbeat_url "https://push.vigilmon.online/YOUR_HEARTBEAT_KEY"
@impl Oban.Worker
def perform(_job) do
# Ping Vigilmon heartbeat monitor
:httpc.request(:get, {@vigilmon_heartbeat_url, []}, [], [])
:ok
end
end
Schedule it every 5 minutes in your config:
# config/config.exs
config :your_app, Oban,
plugins: [
{Oban.Plugins.Cron,
crontab: [
{"*/5 * * * *", YourApp.Workers.HeartbeatWorker}
]}
]
If Oban stops processing jobs, Vigilmon alerts you — even if the app itself is responding to HTTP requests.
SSL Certificate Monitoring
Phoenix apps on custom domains need SSL monitoring:
- In Vigilmon, add an SSL Monitor for your domain
- Set alert threshold: 14 days before expiry
- Set critical threshold: 7 days before expiry
This catches Let's Encrypt renewal failures before they cause production outages.
Multi-Region Checks for Phoenix on Fly.io
Fly.io deploys Phoenix apps in multiple regions. Configure Vigilmon to check from multiple locations:
- Europe (Frankfurt/Amsterdam)
- US East/West Coast
- Asia Pacific
This ensures that even with Fly's anycast routing, every region is responding correctly.
Status Page Integration
For SaaS products built on Phoenix, add a public status page:
- In Vigilmon, go to Status Pages → Create New
- Add your key monitors (main app, API, WebSocket endpoint)
- Publish at
status.yourapp.com - Link it from your app's footer and docs
LiveView-Specific Monitoring
Phoenix LiveView uses long-lived WebSocket connections. Your HTTP uptime monitor won't catch LiveView-specific issues. Consider:
- Monitor the WebSocket endpoint directly:
wss://yourapp.com/live/websocket - Add a synthetic test user that triggers a LiveView mount (available in Vigilmon's advanced monitoring plans)
Alerting in Production
Recommended alert setup for Phoenix teams:
| Alert Type | Threshold | Action |
|---|---|---|
| HTTP down | 2 consecutive failures | PagerDuty/Slack |
| SSL expiry | 14 days | |
| Health check fail | 1 failure | Slack |
| Oban heartbeat missed | 10 min | Slack + email |
Summary
Vigilmon complements Phoenix's built-in fault-tolerance with external visibility. The key monitors for any Phoenix app:
- HTTP uptime — your main domain, 60s interval
-
Health endpoint —
/healthwith DB check - SSL certificate — 14-day warning
- Oban heartbeat — job processing liveness
- Status page — public transparency for users
Vigilmon — uptime monitoring, SSL alerts, and status pages for Elixir/Phoenix applications.
Top comments (0)