Logs, metrics, and operations

Health, logs and the audit trail, Prometheus metrics and alerts, and day-to-day tasks.

/api/health needs no sign-in and names nothing: it answers ok; degraded when a ready snapshot's index is missing or automatic ingest has stopped or stopped responding; and 503 when the catalog cannot be read.

Logs

Logs go to the journal (journalctl -u pinax-web -u pinax-ingest), as text:

2026-10-28 20:32:50 INFO pinax: Pinax 0.14.0 started: environment prod, sign-in header, catalog postgresql+psycopg://pinax@db.example.org/pinax, data in /var/lib/pinax
2026-10-28 20:32:57 INFO pinax.request: GET /api/tree 200 in 122 ms, 6 index queries 27 ms [user=fujimoto_a address=10.20.4.17 request=c4b8784fe19b4890]
2026-10-28 20:33:02 INFO pinax.audit: view.saved: View 'Tumor atlas' saved, shared with the Fujimoto Lab [user=fujimoto_a address=10.20.4.17 request=51d0c2a7e3b94b11]

For a log collector (Splunk, Elastic, Loki, or the like), PINAX_LOG_FORMAT=json writes one JSON object per line, with ts (UTC), level, logger, message, request_id, user, and address, and the details of each request (http: method, path, route, status, ms, bytes, queries, query_ms, slow) and audit event (audit: id, action, actor_id, detail) as fields of their own. To write to files rather than the journal, and to keep every audit event in a file of its own for security monitoring:

PINAX_LOG_FILE=/var/log/pinax/pinax.log
PINAX_AUDIT_LOG=/var/log/pinax/audit.log

The services' units make /var/log/pinax; deploy/logrotate/pinax rotates the files daily and keeps 90 days:

sudo install -m 0644 /opt/pinax/deploy/logrotate/pinax /etc/logrotate.d/pinax

The audit log in a file is a copy: the catalog keeps every event, and People and access shows them.

Metrics

/metrics answers in Prometheus's format, to trend Pinax and the storage it reports on and to alert when something goes wrong. It is off until PINAX_METRICS_TOKEN is set, and then answers only requests that send that token:

openssl rand -hex 32 | sudo tee /etc/prometheus/pinax-metrics-token

Put the same token in /etc/pinax/pinax.env as PINAX_METRICS_TOKEN=..., restart pinax-web, and add the scrape job in deploy/prometheus/pinax-scrape.yml to Prometheus. /metrics is served by the web app, so it is reached the way pages are: through the proxy in front of Pinax (deploy/oauth2-proxy/pinax.cfg lets GET /metrics through without signing in, as it does /api/health, and Pinax checks the token), or on Pinax's own port from the Prometheus host.

The figures name filesystems, never labs, people, or paths. From the catalog, worked out when Prometheus asks (at most every 15 seconds), and so whichever process did the work:

MetricWhat it is
pinax_scan_last_success_timestamp_seconds, pinax_ingest_last_success_timestamp_secondsWhen each filesystem's newest ingested scan was taken, and when it was ingested
pinax_scan_last_failure_timestamp_secondsWhen its newest failed or skipped scan was taken: newer than the last success means the newest scan was not ingested
pinax_scan_duration_seconds, pinax_ingest_duration_secondsHow long the newest scan took fs-inventory, and its ingest Pinax
pinax_filesystem_bytes, _allocated_bytes, _files, _directories, _cold_bytes, pinax_scan_errorsThe newest scan's totals: its size, space on disk, files, folders, data unchanged for PINAX_COLD_DAYS, and entries not read
pinax_filesystem_capacity_bytes, _used_bytes, _growth_bytes_per_month, _fill_timestamp_seconds, _fill_earliest_timestamp_secondsCapacity, use, its trend, when it fills at the trend, and when it could at the fast end of the trend's range (as on Capacity)
pinax_snapshots{status}, pinax_index_bytesSnapshots by state, and the size of the indexes kept
pinax_watcher_up, pinax_watcher_last_heartbeat_timestamp_secondsWhether automatic ingest is running and responding
pinax_search_jobs{status}, pinax_users{state}, pinax_labs{state}, pinax_sessions_activeSearches in the background, people, labs and departments, and local sign-in sessions
pinax_var_size_bytes, pinax_var_free_bytesPinax's own disk, PINAX_VAR_ROOT
pinax_catalog_up, pinax_info{version,database}Whether the catalog can be read, and Pinax's version

From the web app itself, since it started (with rate() for rates):

MetricWhat it is
pinax_http_requests_total{method,route,status}, pinax_http_request_duration_seconds{method,route}Requests by route (its template, such as /api/views/{view_id}) and status, and how long they took
pinax_index_queries_total, pinax_index_query_seconds_totalIndex queries for requests, and their time
pinax_queries_stopped_total{reason}Requests stopped: timeout, busy (no whole-filesystem turn in time), or gone (the browser left)
pinax_catalog_busy_totalRequests turned away as busy: no catalog connection was free within 10 seconds
pinax_wide_queries{state}Whole-filesystem file queries running, and waiting for a turn
pinax_search_jobs_finished_total{status}Searches in the background finished: done, failed, or stopped
pinax_audit_events_total{action}Audit events, by action: auth.signed_in, auth.sign_in_failed, and auth.locked are sign-ins; auth.emergency_signed_in and auth.emergency_sign_in_failed the emergency sign-in

and, on Linux, the process's own memory, CPU, and open files (process_*). deploy/prometheus/pinax-alerts.yml has alert rules to start from: Pinax or its catalog down, a scan not ingested, a filesystem with no new scan for eight days, automatic ingest stopped, a filesystem filling within 90 days or 90% full, Pinax's own disk 90% full, slow pages, server errors, requests turned away as busy, searches turned away for want of a turn, many failed sign-ins, and any use of the emergency sign-in.

Tasks

TaskHow
See scans and their statusScans, or pinax snapshots
A failed or skipped scanScans shows the error; fix the cause and run pinax ingest on the scan
Automatic ingest not respondingsystemctl status pinax-ingest and its journal
Too little disk for indexesLower PINAX_KEEP_SNAPSHOTS; pruning runs after every ingest. A build needs room for one more index while it runs (Sizing)
People see "Pinax stopped this after 180 seconds"A search or comparison of a whole filesystem read for longer than PINAX_QUERY_TIMEOUT: search within a folder, or narrow it by name, type, size, or age. To allow longer, raise PINAX_QUERY_TIMEOUT and the proxy's timeout with it. The log names each one (Stopped /api/files: timeout after 180 s)
People see "Pinax is already running as many searches of whole filesystems as it allows"Others ran meanwhile: raise PINAX_WIDE_QUERIES if the server has the cores and memory
Pages are slow while a large search runsFewer whole-filesystem searches at once (PINAX_WIDE_QUERIES) leave the rest more of the cores (Many people at once)
People see "Pinax is busy: more people are using it at once than it can serve"No catalog connection was free within 10 seconds (pinax_catalog_busy_total, and Turned away in the log). With PostgreSQL, raise PINAX_DATABASE_POOL_SIZE within the database's max_connections; see Sizing
Scan folders filling the diskPinax never deletes them: delete the folders of pruned snapshots (pinax snapshots lists each one's status and folder)
An index was lost or damagedpinax rebuild SNAPSHOT_ID, from its scan; /api/health is degraded and counts indexes_missing while one is missing
Someone forgot their password, or is locked out (local sign-in)Their page under People and access, Set a new temporary password; or pinax user password USERNAME
Read the audit logAudit log, for administrators and auditors: found by person, change, lab, folder, and day, with CSV (The audit log); each person's and lab's page shows its recent changes, and All data the latest under Recent activity; every event is in the log too (pinax.audit, and PINAX_AUDIT_LOG if set), and the whole log is the catalog's audit_event table (below)
Review who has access to whatAccess review: what is worth a look, every role and membership with when it was given, a CSV, and Record a review (Access review)
Someone leavesDeactivate them on their page: they cannot sign in, their sessions end, and their API tokens are revoked; a service token is no one's, so revoke it under API tokens when its service ends
Entra ID is failing, and nobody can sign inAn emergency account signs in at /auth/emergency; or fix the settings on the server, or switch to local sign-in for a while (When Entra ID fails)
A script stops workingIts token expired, was revoked, or its person was deactivated: Troubleshooting
A lab asks why a past month's charge changedSee Charges and statements
Someone cannot see their lab's dataCheck People and access (membership) and Folders and labs (the folder is mapped to their lab)
Someone gets 401 after signing inTheir username (the header named by PINAX_AUTH_HEADER) is not an active person in the catalog
A folder shows "could not be read completely"The scanner lacked permission somewhere below it; see Storage health
Move to a new fs-inventory releasescripts/install-fs-inventory.sh --version vX.Y.Z; Pinax reads schema versions 2 and 3

The whole audit log, newest first (every change in the app, by import, and from the command line, and every sign-in with local sign-in; never a password):

sudo -u pinax sqlite3 /var/lib/pinax/pinax.db "SELECT ts, action, summary FROM audit_event ORDER BY ts DESC LIMIT 100"

On PostgreSQL, the same query with psql:

sudo -u pinax psql "postgresql://pinax@db.example.org/pinax" -c "SELECT ts, action, summary FROM audit_event ORDER BY ts DESC LIMIT 100"