cardinal

Monitoring

Health checks, error logs, jobs and the scheduler.

Health

GET /health answers 200 ok when Postgres answers, and 503 db otherwise. It needs no site host, so a load balancer can call it directly.

cardinal nodes

lists every node that reported in the last day, with its role, memory and seconds since it last reported. A node silent for more than 30 seconds is stale, and the command exits with code 1.

Errors

An unexpected exception in a request or job writes an Error Log Record in the site. The 500 response carries a trace_id, which is also the x-request-id response header and the Error Log's trace_id. Search Error Log by it.

Error Log fieldHolds
TitleThe exception type and message
Trace IDThe request id
FingerprintEqual for repeats of one error
ErrorThe stack trace, with arities in place of arguments
MetadataThe request or job, with passwords, tokens, keys and cookies replaced

Background jobs

cardinal jobs list -t erp.localhost --state retryable
cardinal jobs retry -t erp.localhost 4821
cardinal jobs cancel -t erp.localhost 4821

States are available, scheduled, executing, retryable, completed, cancelled and discarded. A job a killed node left running is picked up again after 35 minutes, or CARDINAL_JOB_RESCUE_AFTER seconds.

Scheduler

Scheduled jobs run from Scheduled Job Type Records, in the site's time zone.

CommandDoes
cardinal scheduler status -t HOSTSays whether the scheduler runs, and why not
cardinal scheduler disable -t HOSTTurns it off in System Settings
cardinal scheduler pause -t HOST --ttl 2hRuns nothing for 2 hours (30m by default)
cardinal scheduler resume -t HOSTEnds a pause
cardinal jobs trigger -t HOST JOB_TYPERuns one Scheduled Job Type now

After downtime, each scheduled job catches up with one run. Missed runs are not backfilled.

Audit logs

LogRecords
Activity LogLogin attempts and logouts
Access LogPDF downloads and data exports
VersionField changes on RecTypes that track changes
Email QueueEvery mail and its delivery status
Webhook Request LogEach webhook attempt, kept 30 days

Log Settings sets how many days each log RecType keeps its rows.

On this page