Skip to Content
mlab docs

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 endpointNo. Use the probes below.
Metrics endpoint (Prometheus, OpenMetrics)No.
Docker healthcheckOn mysql and clickhouse in the compose file. None on app.
Console logsYes, on stdout: docker compose logs app.
Request logsYes, JSON lines in /app_mlab_sh/log/<YYYY-MM-DD>.log (the logs volume).
License statusYes, 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   # 200

The image has no curl or wget. To give app a Docker healthcheck, bash's /dev/tcp works (example):

docker-compose.yml (example)
  app:
    healthcheck:
      test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/8080"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 120s

End 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.

statusMeaningAlert
activeConfirmed by mlab.sh at the last check.-
offlinemlab.sh unreachable; running on the kept license until renewed_until.Warning; critical a day before renewed_until.
startingNo check has completed yet.Only if it lasts.
missing_key, invalid, in_use, expiredPlatform 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):

docker-compose.yml (example)
  app:
    logging:
      driver: json-file
      options: { max-size: "50m", max-file: "5" }

Messages to watch

MessageMeaning
Waiting for MySQL to be up... / Waiting for ClickHouse to be up... repeatingThe 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, reconnectingThe 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 user user; page requests name it user_data and add user_logged.
  • Never written: query strings (they can carry reset tokens) and session cookies.
  • user_ip is the client address only if the reverse proxy sets X-Forwarded-For correctly: 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 -delete

To 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

ConditionCheckSeverity
app not running, or restartingdocker compose ps, container restart countCritical
Sign-in page not answering through the proxyHTTPS probe on /auth/loginCritical
License status not active / offline/api/v1/license/infoCritical
License offline/api/v1/license/info, renewed_untilWarning, then critical before expiry
mysql or clickhouse not healthydocker compose psCritical
Migration error at start-upConsole logsCritical after an upgrade
Disk usage of the Docker volumesHost monitoring, docker system df -vWarning at 80 %
TLS certificate expiryYour proxy or an external probeWarning at 14 days
Backup job failed or older than 24 hYour backup toolingCritical
Many auth/login POSTs from one IPRequest logsInvestigate

On this page