Monitoring
Hearth gives you health checks for your orchestrator, Prometheus metrics, JSON logs without personal content, optional error reports, a list of background jobs, and a weekly summary by mail.
Health checks
| Address | Answers 200 when |
|---|---|
/healthz |
the process runs |
/readyz |
Postgres, Valkey, the file store and the event stream all answer |
Use /readyz for load balancers and after a deploy, /healthz for
"restart if dead" checks. The image's own check is hearth healthcheck,
which exits 0 when /healthz answers:
healthcheck:
test: ["CMD", "/hearth", "healthcheck"]
While Hearth shuts down, /readyz answers 503 so the load balancer stops
sending new requests. A jobs container (HEARTH_ROLE=jobs) serves only
these two addresses.
Metrics
Set METRICS_LISTEN to serve Prometheus metrics at /metrics on a
separate address, for example :9090. Never expose it publicly: put it
on a network only Prometheus reaches. Scrape both the web and the jobs
containers.
The main metrics:
hearth_http_requests_totalandhearth_http_request_seconds, by route, method and status;hearth_jobs_totalandhearth_job_secondsby job kind and result, andhearth_job_lateness_seconds;- the job lanes, from the jobs process:
hearth_job_lane_jobsby state,hearth_job_lane_due,hearth_job_lane_oldest_due_seconds,hearth_job_lane_held; - the Copilot:
hearth_copilot_runs_total,hearth_copilot_first_word_seconds,hearth_copilot_run_seconds; - the database pool:
hearth_db_pool_connectionsby state, with acquires, waits and wait time; hearth_virus_scanner_up, live event streams, sign-ins, and the Go runtime.
Labels are always bounded sets (a route template, a kind, a state), never an id, a path or a person. Use the Postgres and Valkey exporters of your choice for those services.
Worth an alert:
/readyzfailing for more than a minute;hearth_virus_scanner_upat 0 for more than a few minutes;hearth_job_lane_oldest_due_secondsgrowing for an hour (background work is falling behind);- a rising rate of 5xx in
hearth_http_requests_total.
Logs
Hearth writes JSON lines to standard output. Collect them with whatever you use for Docker logs.
- One line per request: method, route template, status, milliseconds, bytes, a request id and the account's id. Health checks are left out.
- Every response carries its request id in
X-Request-Id, and every line logged during that request carries it asrid. When someone reports an error, ask for the time, find the request line, and follow itsrid. - One line per finished job, with warnings for retries and errors for failures.
Logs never carry personal content. File and folder names, paths,
logins, mail addresses, subjects, searches and texts are replaced by a
pseudonym (~ and eight hex digits, the same within one process's
lines, so you can still follow one file through the log). Tokens and
secrets become [redacted]. The Postgres settings in the repository log
slow statements without their values.
LOG_LEVEL sets the level: debug, info (the default), warn or
error.
Error reports
Hearth can send errors to a Sentry-compatible service such as GlitchTip:
ERROR_REPORTS_SERVER_DSN: https://key@errors.example.org/1
ERROR_REPORTS_WEB_DSN: https://key@errors.example.org/2
ERROR_REPORTS_ENVIRONMENT: production
The server's and the web app's errors go to separate projects. They are scrubbed the same way as the logs.
Administration, Jobs
Background work (indexing, previews made ahead, text recognition, imports, backups, timed jobs) runs as jobs. Administration, Jobs lists them, filtered by All, Waiting, Running, Failed and Done, with a count on each.
- Each job shows its kind, when it is due or finished, the attempt number, and the last error.
- Retry runs a failed job again.
- The bin removes a job that is not running.
- The lanes at the top show how much work is waiting in each lane and whether a lane is held back because the server is busy.
Background lanes wait while the server's memory or processors are busy
(JOBS_PAUSE_MEMORY_PERCENT, 80 by default, and
JOBS_PAUSE_CPU_PERCENT, 90). Heavy work runs faster in the night
window, JOBS_NIGHT_HOURS (01:00-07:00 by default) in JOBS_TIME_ZONE.
The weekly summary
Once a week Hearth mails its administrators a short summary. It needs
outgoing mail (MAIL_*, see the configuration
reference).
At the top, "Needs your attention" lists real problems only; a quiet week says "Nothing needs your attention." It lists:
- a certificate for Hearth's or the Office engine's address that is not valid or has less than a quarter of its lifetime left;
- jobs that failed for good, recurring jobs whose latest run failed, and jobs waiting after three or more failed attempts;
- uploads the virus scan refused;
- personal storage or a library at 90% of its quota or more, and the file store's disk with less than 10% free (local storage only);
- engines that do not answer (Office, the virus scanner, LiteLLM, Qdrant, Vaultwarden), asked twice 15 seconds apart;
- 25 or more errors logged in the week, with the most frequent.
Then a few figures per area: people and sign-ins, storage and links, sharing and spaces, calendar and notes, Copilot use (counts only, never what was asked), and the system (versions running, uptime, database size, slowest routes).
In Administration, Weekly summary you choose whether it is sent, the day and hour (Monday 08:00 by default), the time zone, and who gets it: all administrators with an email address, or a list of addresses. Send a preview now mails the last seven days to your own address at once.
docker compose exec -T hearth /hearth digest preview --to admin@example.org
docker compose exec -T hearth /hearth digest show