How to Monitor Livebook with Vigilmon
Livebook transforms Elixir development with collaborative, reproducible notebooks — interactive cells, live data visualization with Kino, and real-time collaboration over the BEAM. Organizations deploy Livebook as a persistent internal tool for data analysis, reporting, and runbooks. But a deployed Livebook server is a long-running service with its own failure modes: the server process can hang, hub connectivity can drop, notebook kernels can stall in expensive cells, and the underlying Phoenix socket can silently disconnect collaborators.
This tutorial sets up production monitoring for a self-hosted Livebook deployment:
- HTTP uptime monitoring for the Livebook web interface
- Heartbeat monitoring for long-running notebook jobs
- Hub connectivity health checks
- Slack alerts when the server becomes unreachable
Why Monitor Livebook?
| Signal | What it catches | |---|---| | Server availability | Phoenix process crash, OOM kill, port conflicts | | Hub connectivity | Livebook Teams hub disconnection, token expiry | | Notebook kernel health | Stalled cells blocking the runtime supervisor | | Response time | Overloaded server struggling under notebook load | | SSL certificate | Expired cert locking out all collaborators |
Livebook is often deployed as internal infrastructure and treated as "always on" — until the data team can't access their runbooks during an incident.
Step 1: Verify Livebook's Health Endpoint
Livebook ships with a built-in health endpoint at GET /health. It returns HTTP 200 when the server is running:
curl https://livebook.yourcompany.com/health
# => {"application":"livebook","version":"0.14.0"}
This is your primary Vigilmon target — no configuration required.
Step 2: Add Vigilmon Uptime Monitoring
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter your Livebook health URL:
https://livebook.yourcompany.com/health. - Set Check interval to
1 minute. - Set Expected HTTP status to
200. - Under Advanced, add a Response body contains check:
"application":"livebook". - Click Save.
Vigilmon now checks your Livebook server every minute and alerts on any outage.
Step 3: Monitor the Web Interface Directly
The /health endpoint checks the Elixir process, but you also want to confirm the web UI is reachable:
- Click Add Monitor → HTTP / HTTPS.
- Enter the root URL:
https://livebook.yourcompany.com/. - Set Expected HTTP status to
200or302(Livebook may redirect to login). - Set Check interval to
2 minutes. - Add a Response body contains check:
Livebook(checks the HTML title).
This catches cases where the Phoenix router is broken but the health plug still responds.
Step 4: Add a Heartbeat for Scheduled Notebooks
Teams often run Livebook notebooks on a schedule — daily reports, data refreshes, automated runbooks. Use Vigilmon heartbeats to confirm these jobs complete successfully.
Add a heartbeat ping to the end of your scheduled notebook using Kino:
# In the final cell of your scheduled notebook
vigilmon_heartbeat_url = System.get_env("VIGILMON_HEARTBEAT_URL")
if vigilmon_heartbeat_url do
Req.get!(vigilmon_heartbeat_url)
IO.puts("Heartbeat sent to Vigilmon ✓")
end
Set the environment variable in your Livebook deployment:
# In your Livebook startup environment
export VIGILMON_HEARTBEAT_URL="https://vigilmon.online/api/heartbeat/YOUR_HEARTBEAT_ID"
Create the heartbeat in Vigilmon:
- Click Add Monitor → Cron / Heartbeat.
- Set the expected interval to match your notebook schedule (e.g.,
24 hours). - Set grace period to
1 hour. - Copy the generated heartbeat URL into the
VIGILMON_HEARTBEAT_URLenvironment variable.
If the notebook stalls mid-execution or fails to reach the final cell, the heartbeat is never sent and Vigilmon alerts you.
Step 5: Monitor Livebook Hub Connectivity
If you're using Livebook Teams, monitor hub connectivity with a dedicated heartbeat GenServer you can attach via a persistent notebook:
# A long-running notebook cell that monitors hub health
defmodule LivebookHubMonitor do
use GenServer
@check_interval :timer.minutes(5)
@heartbeat_url System.get_env("VIGILMON_HEARTBEAT_URL")
def start_link(_), do: GenServer.start_link(__MODULE__, nil, name: __MODULE__)
def init(_) do
schedule()
{:ok, nil}
end
def handle_info(:check, state) do
# Verify hub connectivity by checking if hub env vars are accessible
hub_connected = System.get_env("LIVEBOOK_TEAMS_AUTH_MODE") != nil
if hub_connected && @heartbeat_url do
Req.get!(@heartbeat_url)
end
schedule()
{:noreply, state}
end
defp schedule, do: Process.send_after(self(), :check, @check_interval)
end
{:ok, _pid} = GenServer.start_link(LivebookHubMonitor, nil, name: :hub_monitor)
IO.puts("Hub monitor running")
Run this cell in a persistent notebook that stays open on your Livebook server.
Step 6: SSL Certificate Monitoring
Livebook deployments are typically HTTPS-only. An expired certificate locks out all collaborators immediately.
- Click Add Monitor → HTTP / HTTPS.
- Enter
https://livebook.yourcompany.com/health. - Under SSL Certificate, enable Cert expiry alerts.
- Set alert threshold: notify when certificate expires in < 21 days.
This gives you three weeks to renew before collaborators start seeing certificate errors.
Step 7: Set Up Alerts
- Go to Alert Channels → Add Channel.
- Choose Slack, Email, or PagerDuty.
- For the HTTP monitors: alert after 2 consecutive failures (avoids transient network noise).
- For scheduled notebook heartbeats: alert immediately on first miss.
- For SSL: alert via email with 21-day and 7-day warnings.
- Assign alert channels to all Livebook monitors.
For team deployments, also create a Status Page:
- Go to Status Pages → Create Page.
- Add your Livebook uptime monitor.
- Share the URL internally so the team can self-check before filing tickets.
Key Metrics to Watch
| Metric | Vigilmon feature | What to alert on |
|---|---|---|
| Server availability | HTTP monitor on /health | Any non-200 or timeout |
| Web UI accessibility | HTTP monitor on / | Any non-200/302 |
| Scheduled notebook completion | Heartbeat monitor | Missing for > grace period |
| SSL certificate | Cert expiry monitor | Expires in < 21 days |
| Response time | Response time chart | P95 > 3s (Livebook pages are heavier) |
Conclusion
Livebook is indispensable for Elixir data teams — but a server outage during an incident response is the worst time to discover your monitoring runbook isn't running. With Vigilmon watching your health endpoint, web UI, SSL certificate, and scheduled notebook heartbeats, your team has confidence that Livebook is always available when they need it.
Get started free at vigilmon.online.