Monitoring and logs
Probe a tprm.mlab.sh instance, read its console and request logs, and know which conditions to alert on.
What the platform exposes
| Available | |
|---|---|
| Dedicated health endpoint | No. Use the probes below. |
| Metrics endpoint (Prometheus, OpenMetrics) | No. |
| Docker healthcheck | On mysql and clickhouse in the compose file. None on app. |
| Console logs | Yes, on stdout: docker compose logs app. |
| Request logs | Yes, JSON lines in /app_mlab_sh/log/<YYYY-MM-DD>.log (the logs volume). |
| License status | Yes, GET /api/v1/license/info with an API key. |
Probes
Liveness
Port 8080 opens only after the app has reached MySQL and ClickHouse, applied migrations and checked the license (see Start-up sequence). The sign-in page needs no database:
curl -fsS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8080/auth/login # 200The image has no curl or wget. To give app a Docker healthcheck, bash's
/dev/tcp works (example):
app:
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/8080"]
interval: 30s
timeout: 5s
retries: 3
start_period: 120sEnd to end, with the license
Create an API key (Organization > API keys) for monitoring. Read-only keys on
Free are enough: this is a GET.
curl -fsS -H "Authorization: token mlab_..." https://tprm.example.com/api/v1/license/info{"tier":"...","status":"active","renewed_until":"2026-11-28 09:00:00 UTC","places_used":1,"places_max":1, ...}The call reads MySQL, so it fails when the database is down. It answers while the platform is paused, so it is the one probe that tells you why.
status | Meaning | Alert |
|---|---|---|
active | Confirmed by mlab.sh at the last check. | - |
offline | mlab.sh unreachable; running on the kept license until renewed_until. | Warning; critical a day before renewed_until. |
starting | No check has completed yet. | Only if it lasts. |
missing_key, invalid, in_use, expired | Platform paused. | Critical. See License status. |
Databases and storage
docker compose ps # mysql and clickhouse show (healthy)Document storage is tested by /api/v1/files/status?check=1, which writes, reads
and deletes a small object. It needs an administrator's session, not an API key:
use it by hand after a change, see Documents.
Console logs
docker compose logs app shows the start-up, license, migration and error
messages, at INFO level and above, plus one line per request:
Request: GET [203.0.113.7] [<user uuid>/<organisation>] - d/
API V1 Request: GET [203.0.113.7] [<organisation>] - /providers/Docker keeps these in its own log driver. With the default json-file driver they
grow without limit; cap them (example):
app:
logging:
driver: json-file
options: { max-size: "50m", max-file: "5" }Messages to watch
| Message | Meaning |
|---|---|
Waiting for MySQL to be up... / Waiting for ClickHouse to be up... repeating | The app cannot reach a database; it retries every 2 s and does not serve yet. |
MySQL migration error: ... / ClickHouse migration error: ... | A migration failed. The app still starts; fix the cause and restart app. See Troubleshooting. |
License guard: <status> <detail> | Result of each license check, every hour. |
License guard: refused a license from the server: ... | An answer whose signature or instance id did not match. |
ClickHouse connection lost, reconnecting | The native connection dropped; the next query reconnects. |
MySQL health check conn error: ... | MySQL refused a connection at start-up. |
Failed to write log to ./log/<date>.log: ... | The request log file cannot be written: check the logs mount (/app_mlab_sh/log, 1.6.3 image or later). |
Admin setup (admin@localhost), valid 72h, open once: ... | admin@localhost has no password yet. |
Request logs
Unless LOG_TO_FILE=false, each request is also written as one JSON object per
line to /app_mlab_sh/log/<YYYY-MM-DD>.log, a new file each day (container time
zone, Europe/Paris).
{"path":"/providers/","user_ip":"203.0.113.7","method":"GET","organization":{...},"user":{...},"is_admin":false,"timestamp":"2026-11-21T10:02:11.120+01:00"}- Fields:
path,method,user_ip,organization, the signed-in user (UUID, name, email, organisation) when there is one,is_admin,timestamp. API requests (/api/v1) name the useruser; page requests name ituser_dataand adduser_logged. - Never written: query strings (they can carry reset tokens) and session cookies.
user_ipis the client address only if the reverse proxy setsX-Forwarded-Forcorrectly: see Reverse proxy.
Read them on the host:
docker compose exec app sh -c 'tail -f log/$(date +%F).log'The files hold personal data (emails, IPs) and are never rotated or deleted by the app. Prune them on your retention schedule, for example from cron (example):
docker compose exec -T app find /app_mlab_sh/log -name '*.log' -mtime +90 -deleteTo collect logs from stdout instead (Loki, Elastic, a cloud agent), set
LOG_TO_FILE=false: the request lines stay on the console.
Activity
Changes to records are stored in ClickHouse (platform_activity) for 365 days and
shown in the platform. They are business activity, not operational logs.
What to alert on
| Condition | Check | Severity |
|---|---|---|
app not running, or restarting | docker compose ps, container restart count | Critical |
| Sign-in page not answering through the proxy | HTTPS probe on /auth/login | Critical |
License status not active / offline | /api/v1/license/info | Critical |
License offline | /api/v1/license/info, renewed_until | Warning, then critical before expiry |
mysql or clickhouse not healthy | docker compose ps | Critical |
| Migration error at start-up | Console logs | Critical after an upgrade |
| Disk usage of the Docker volumes | Host monitoring, docker system df -v | Warning at 80 % |
| TLS certificate expiry | Your proxy or an external probe | Warning at 14 days |
| Backup job failed or older than 24 h | Your backup tooling | Critical |
Many auth/login POSTs from one IP | Request logs | Investigate |
Reverse proxy and TLS
Put Caddy, nginx or Traefik in front of port 8080: TLS, upload size, client IP headers, PUBLIC_URL and the single sign-on callback.
Backup and restore
What a tprm.mlab.sh instance stores and where, the exact backup and restore commands, how to test a restore and what to save before an upgrade.