Monitoring and logs
Health probes for app and executor, licence status, where ir.mlab.sh writes its logs and in what format, and what to alert on.
Health probes
ir.mlab.sh has no dedicated health or metrics endpoint. These are the signals that exist, and what each one proves.
| Probe | Command | Healthy | Proves |
|---|---|---|---|
| App HTTP | GET /api/v1/ | 200 with {"message": "Hello, ..."} | The HTTP server is up. It only binds after MySQL and ClickHouse answered, migrations ran and the boot licence check finished. It does not re-test the databases on each call. |
| Executor | GET http://executor:8090/health (compose network only) | 200 with {"status":"ok","service":"playbook-executor"} | The executor accepts playbook runs. |
| Licence | GET /api/v1/license/status with an admin account key | guard.status is active | The last hourly check with mlab.sh succeeded. |
| Databases | Compose healthchecks (mysqladmin ping, clickhouse-client --query "SELECT 1") | healthy in docker compose ps | The database process answers. |
The app and executor images contain no curl or wget, so there is no
in-container healthcheck for them. Probe from the host, the proxy or your
monitoring system.
# App, through the proxy
curl -fsS https://ir.example.com/api/v1/ >/dev/null && echo app ok
# Executor, from a throwaway container on the project network (example)
docker run --rm --network ir-mlab_default curlimages/curl:8.10.1 \
-fsS http://executor:8090/health
# Databases
docker compose psLicence status
Create an account key for an admin user under Settings > API keys, then:
curl -fsS https://ir.example.com/api/v1/license/status \
-H "Authorization: token $IR_ADMIN_KEY"The guard object carries:
| Field | Meaning |
|---|---|
status | starting, active, offline (mlab.sh unreachable, running on the kept licence), missing_key, invalid, in_use (another instance holds it), expired |
licensed | false means the console is locked |
expires_at | When the kept signed licence expires (7 days after issue, renewed hourly) |
last_check_ok, last_check_at | Last successful and last attempted check |
consecutive_failures | Failed checks in a row |
detail | Human-readable reason, also shown under Settings > License |
The same state is logged at every check as License guard: <status> <detail>.
See Licensing for what each state means.
Logs
Container output
app and executor log to stdout at INFO level and above, as plain-text lines
with a timestamp, the level and the message. Read them with Docker:
docker compose logs -f --since 1h app
docker compose logs -f executorDocker's default json-file driver keeps these without a size cap. Set a limit, or
ship them to your log platform with a logging driver:
x-logging: &logging
driver: json-file
options: { max-size: "50m", max-file: "5" }
services:
app: { logging: *logging }
executor: { logging: *logging }Useful lines, verbatim:
| Message | Meaning |
|---|---|
Waiting for MySQL to be up... / Waiting for ClickHouse to be up... | Boot blocked on a database (repeats every 2 s). |
MySQL migration error: ... / ClickHouse migration error: ... | A migration failed at boot. |
Server ready to accept connections | Boot finished. |
License guard: <status> <detail> | Result of each licence check. |
COOKIE_SECURE=false - the session cookie will be sent over plain HTTP... | Warning at boot. |
INTERNAL_SECRET is not set - refusing internal authentication | Playbook callbacks will fail. |
App token refused on <method> <path> (key note: ...) | An integration's token tried something other than creating alerts. |
request logging disabled until restart: ... | The request log could not be written (see below). |
request log queue saturated - dropping log lines | Request-log writer cannot keep up; lines are dropped. |
ClickHouse health check failed: ... | ClickHouse unreachable. |
[Executor] Executing '<playbook>' (run <id>, trigger: <type>) | A playbook run started (executor). |
Request log
Every HTTP request is appended as one JSON object per line to
/app_mlab_sh/log/<YYYY-MM-DD>.log, bind-mounted to ./log on the host. A new
file starts each day. Fields include timestamp, method, path, user_ip,
user_agent, auth (Session, AccountKey, AppToken, Internal,
Anonymous), is_admin, organization (with license and locked) and the
signed-in user's details.
{"auth":"Anonymous","is_admin":false,"method":"POST","organization":{"license":"free","locked":false,...},"path":"/auth/login","timestamp":"2026-10-04T14:54:36.071224803+02:00","user_agent":"Mozilla/5.0 ...","user_ip":"172.22.0.1"}The file date and timestamps follow the container time zone. The images set
TZ=Europe/Paris; put TZ=... in .env to change it.
The log directory must be writable by the container user. The app runs as
mlab, not root. If ./log is owned by root (Docker creates a missing bind-mount
directory as root), the first write fails, the app logs
request logging disabled until restart, and nothing is written until the next
restart. Fix the ownership, then restart app:
sudo chown "$(docker compose exec -T app id -u):$(docker compose exec -T app id -g)" log
docker compose restart appWrites happen off the request path: a full disk disables request logging rather than slowing requests down.
Retention
The app never rotates or deletes request logs. Since each day is a separate file that is closed at the date change, plain deletion is enough, for example from cron:
find /home/ops/ir-mlab/log -name '*.log' -mtime +90 -deletePick the period your privacy policy allows: these files contain IPs, emails and names.
Metrics
There is no Prometheus or other metrics endpoint. Use container-level metrics
(docker stats, cAdvisor, node exporter) for CPU, memory, disk and network, and
the application's own dashboards (Reporting) for MTTA/MTTR and SLA
compliance.
What to alert on
| Condition | Source | Severity |
|---|---|---|
GET /api/v1/ fails for 2+ minutes | External probe | Page |
Licence guard.licensed is false | Licence status | Page: the console is locked |
Licence status is offline, or consecutive_failures ≥ 3 | Licence status | Warn: check egress to mlab.sh:443 before expires_at |
expires_at less than 48 h away | Licence status | Page |
Any migration error line | Container logs | Page, especially after an upgrade |
request logging disabled or queue saturated | Container logs | Warn |
Executor /health fails | Probe | Warn: playbooks don't run |
mysql or clickhouse not healthy | docker compose ps | Page |
| Container restart count rising | Docker | Warn |
| Free space on the Docker volume filesystem under 15 % | Host | Warn; ClickHouse and evidence grow over time |
Webhooks in state failing or broken | Settings > Webhooks | Warn: notifications are not reaching their destination |
| Nightly backup missing or abnormally small | Your backup job | Warn |
Webhook deliveries are retried 3 times in total, 5 s then 30 s apart
(IR_WEBHOOK_BACKOFF_MS overrides the waits, in milliseconds, comma separated).
Reverse proxy and TLS
Serve ir.mlab.sh over HTTPS behind Caddy, nginx or Traefik: the upstream, the headers that matter, body size, and the settings that must match your hostname.
Backup and restore
What to back up on an ir.mlab.sh host, the exact commands for the MySQL dump and volume archives, how to restore on a new host, and how to test a restore without disturbing production.