shed
Run Shed / Operations
Run Shed

Operations

Watch a Shed server: usage, the admin page, health checks, metrics, logs and alerts when something goes wrong.

View Markdown

Shed watches itself. It counts what people do, keeps request metrics, writes structured logs, and alerts you when something breaks. It stores all of this on your own server and sends nothing to anyone else.

WhatWhereFor
Usage/admin and /api/admin/usageSign-ups, active people, activation, top apps, limits hit, recent errors
AlertsEmail to admins, a Slack or Discord webhookServer errors, failing emails, crashes, a filling disk
Health/healthzUptime checks and your platform's restarts
Metrics/metrics on a private portRequest rates, latency, error rates, totals, in Prometheus or Grafana
Logsstdout, one JSON object per lineEvery request and error, with stack traces

The admin page

Open /admin signed in as one of the addresses in SHED_ADMIN_EMAILS. To anyone else it doesn't exist. It shows:

  • People, active people, apps and errors, today and over the week. Active means they deployed, shared, signed in or opened a shared app.
  • Activation for everyone who signed up in the last 30 days: how many deployed an app, shared it, and had someone else open it. Also the median time from sign-up to first deploy.
  • The last 14 days, day by day: sign-ups, active people, deploys, shares, opens by others, limits hit and errors.
  • Most opened apps and plan limits hit this week, so you can see what's catching on and who needs more room.
  • Recent sign-ups, with how they arrived (the terminal, the web, or someone's shared link), and recent errors.

The same numbers are JSON at /api/admin/usage?days=30, for a spreadsheet or a script.

Alerts

Shed alerts you when:

ProblemWhy it matters
A request fails with a server error (5xx)Something is broken for a user right now.
Sign-in or invite emails fail to sendNobody new can get in.
The process crashesIt exits so your platform restarts it, and tells you first.
The data volume is 80% fullDeploys and records will start failing.

Each alert says what happened and how often, and links to /admin. The same problem alerts at most once every 30 minutes, and the next alert counts the repeats in between.

Alerts go to SHED_ALERT_EMAILS, or if that's unset, to the addresses in SHED_ADMIN_EMAILS. Email needs RESEND_API_KEY. Because a failing email service is one of the things worth an alert, also set SHED_ALERT_WEBHOOK to a Slack or Discord incoming webhook:

Terminal
$ fly secrets set SHED_ALERT_WEBHOOK=https://hooks.slack.com/services/...

Alerts are logged as "level":"alert" too, so they're in the logs even when nothing can be delivered.

Uptime

/healthz answers 200 {"ok":true,...} when the database responds and the disk has room, and 503 when it doesn't. On Fly, the example config (deploy/fly.example.toml) checks it every 30 seconds and restarts the machine when it fails.

A machine can't report that it's down, so check from outside as well: point an uptime service, or a scheduled job such as a GitHub Action, at https://shed.example.com/healthz every few minutes. Check twice a minute apart before alerting, so a machine waking from auto-stop doesn't count as an outage.

Metrics

Set SHED_METRICS_PORT (Fly: 9091, already in deploy/fly.example.toml) and Shed serves Prometheus metrics at /metrics on that port only, never on the public one.

MetricType
shed_http_requests_total{route,status}counterRequests by route name and status class (2xx…5xx)
shed_http_request_duration_seconds{route}histogramResponse time by route
shed_errors_totalcounterServer errors
shed_events_total{kind}counterSign-ups, deploys, shares, invites and the rest
shed_app_views_total{viewer}counterApp page loads by owners, members and anonymous visitors
shed_users, shed_apps, shed_recordsgaugeTotals
shed_live_streamsgaugeOpen live-update connections
shed_disk_used_ratiogaugeHow full the data volume is
shed_alerts_total{result}counterAlerts sent and alerts that couldn't be delivered

Routes are names such as api_deploy, auth or app_data_write, never paths, so metrics hold no app names, emails or tokens. On Fly, these appear in the managed Grafana at fly-metrics.net with no setup. Useful panels:

promql
sum(rate(shed_http_requests_total{status="5xx"}[5m])) / sum(rate(shed_http_requests_total[5m]))   # error rate
histogram_quantile(0.95, sum by (le, route) (rate(shed_http_request_duration_seconds_bucket[5m])))   # p95 latency by route
increase(shed_events_total{kind="signup"}[1d])                                                     # sign-ups per day

Logs

Shed writes one JSON object per line on stdout:

JSON
{"t":"2026-12-03T10:12:04.511Z","level":"info","msg":"request","method":"POST","route":"api_deploy","status":200,"ms":84}
{"t":"2026-12-03T10:12:09.002Z","level":"error","msg":"database is locked","route":"app_data_write","method":"POST","status":500,"stack":"Error: database is locked\n    at ..."}

Levels are info, warn, error, alert and fatal. On Fly:

Terminal
$ fly logs | grep '"level":"error"'

What's recorded

The usage log stores the account, the app's name and a few numbers for each sign-up, sign-in, deploy, share, invite, rollback, deletion, limit reached and server error. It also records the first time each day that someone opens an app shared with them. It never stores what's inside an app or its records, and no IP addresses. Entries older than about 13 months are deleted automatically. Request logs and metrics carry route names, never full addresses, so tokens in sign-in links never reach them.

↑↓ to move, Enter to open