Observability
Health and readiness, process and deployment status, metrics, logs and alerts, usage history and the audit trail, and what each may hold.
A process answers health checks, status and metrics on its operations
listener (127.0.0.1:7702 by default, 0.0.0.0:7702 in the image),
unauthenticated, and logs to standard error. The deployment's status, usage
history and audit trail are kept in its stores and read through the
administration API or the operator commands.
What observations hold
Logs at every level, metrics, status and the usage history carry no document content, request body, credential or key secret, and no client's address. The operations listener's answers never wait on a store.
Log lines name a document by its reference, never its id: the first 16 hexadecimal digits of an HMAC-SHA256, under a key drawn when the deployment was founded, of the document's key. An operator who knows a document's id finds its lines by its reference:
mimicd admin doc-ref --database DB --collection COLLECTION DOCUMENTMetric labels hold no document id and no database id: per-database
families sum every database as database="other".
Health
| Path | Answers 200 while |
|---|---|
/livez | The process's heartbeat (each second) ran within the last 5 seconds |
/readyz | The process serves (its schema applied, the deployment founded, not stopping) and reached its home store within the last 5 seconds |
Otherwise each answers 503; /readyz names the conditions unmet, as in
{"ready": false, "unmet": ["home_store_reachable"]}. A store other than
the home out of reach leaves the process ready: that store's partitions
answer unavailable, and /status names it.
Route traffic by /readyz, and restart by /livez. mimicd probe asks
/readyz once and exits 0 on a 200 (--url asks another, --timeout
bounds it); it is the image's health check.
Status
/status on the operations listener is the process's own: its build, its
lease holder id, readiness, the leases it holds, its resident documents and
sessions, each store and whether it reaches it, its public certificate's
expiry, and the deployment's moves and operations as it last read them
(every 10 seconds).
The deployment's status, read from its stores, is mimicd admin status, or
GET /v1/admin/status with status.read: its stores and what they hold,
the registered processes and the leases each holds, the
operations under way, the databases' fences, and attention items:
| Item | Means |
|---|---|
store_unreachable | A store does not answer; its partitions answer unavailable |
process_unseen | A process listed but not seen lately (a lost one stays listed for a day) |
public_certificate_expiring | The public listener's certificate expires soon |
acme_failing | An ACME order keeps failing |
move_failing | A partition's move keeps failing at a step |
mimic_store_map_behind | A move parked until mimicd admin stores reconcile |
documents_quarantined | Documents are quarantined |
migration_unsealed_restored | A restored migration came back verifying: activate it again |
home_fence_orphaned | A partition is fenced by a fence the home no longer records |
home_fence_lift_lost | A fence's lift reached partitions the home has lost |
Every alert a process logged in the last hour is listed too.
Metrics
/metrics serves the metric families of version 3 in the OpenMetrics text
format; mimic_metrics_info{version="3"} says which list a process follows.
Within a version no family is renamed, changes type or meaning, or loses a
label. The repository's mimicd/docs/metrics.md lists every family. Among
them:
| Family | What |
|---|---|
mimic_node_ready | 1 while the process is ready |
mimic_store_reachable{store} | 1 while the process reaches the store |
mimic_store_connections{store,state} | Its pool's connections to each store, acquired or idle |
mimic_journal_transaction_duration_seconds | A partition's appends, from their transaction's start to its commit |
mimic_journal_appends{outcome} | Appends by outcome: ok, refused, ambiguous, error |
mimic_leases_held | Partitions whose lease it holds |
mimic_lease_renewal_duration_seconds | Lease renewals, from their start to their commit |
mimic_http_server_request_duration_seconds | HTTP requests by route and status class |
mimic_gateway_sessions | Client sessions it holds open |
mimic_worker_resident_documents | Documents in memory |
mimic_worker_memory_bytes | What its resident documents and buffers hold, against resident-memory |
mimic_admission_refusals_by_resource | Work refused resource_exhausted at a limit, by resource |
mimic_alerts{alert} | Alert lines it logged, by alert |
mimic_operations{kind,state} | Long-running operations not ended |
mimic_quarantined_documents{store} | Documents quarantined on each store |
mimic_usage_seal_lag_seconds{store} | How far behind the usage history is |
mimic_certificate_expiry_timestamp_seconds | When the public certificate expires |
mimic_migration_sandbox_isolation | The isolation its migration sandboxes run under |
PostgreSQL's own health (its disk, replication lag, connections) is PostgreSQL's metrics: watch them beside these.
Logs
Logs go to standard error, one JSON object per line with ts, level and
message first (log.format = "json", the default), or key=value pairs
(pretty). log.filter is the level logged from: error, warn, info
(the default), debug, trace, or off; it is read again on SIGHUP.
A line that names an alert is one to act on; mimic_alerts counts them
by name. Among them:
| Alert | Means |
|---|---|
mimic_lease_takeover_blocked | A takeover waits for a stuck session it may not end: connect every process as one role |
mimic_store_map_behind | A move the stores and the home disagree about parked: reconcile it |
mimic_stored_count_corrected | A partition's count of what it keeps was wrong and was corrected |
mimic_backup_destination_refused | The backup destination refuses for good: access denied, no such bucket |
mimic_backup_stalled | A backup made no progress for an hour and failed |
mimic_backup_held_too_long | A backup ran longer than its history may be held, and its chain ended |
mimic_backup_chain_segments | A chain would hold more segments than backup_chain_segments: raise it |
mimic_backup_merge_over_budget | A restore or read-back ran past backup.merge-segments |
mimic_backup_verify_failed | A backup's read-back found it not whole |
mimic_home_fence_missing | A fence missing from a partition was set again |
mimic_home_fence_lift_lost | A fence's lift was lost by the home |
A request whose handler panics is answered internal and logged with the
panic's location and route, never its value. There is no OpenTelemetry
export yet: the telemetry.* options are refused.
Usage history
Each store counts, in the same transaction as the data it counts, the
commits each partition makes, the bytes it appends, the outcomes it
records and the bytes its webhooks send, per minute. Once a minute has
ended, it is sealed into the store's usage feed: numbered intervals,
one reading per database, of commits, append, outcomes and
transfer. Each database's retained bytes, and apart its firing_bytes
(webhook firings waiting for delivery), are sampled once a minute. This is
usage format 3.
mimicd admin usage feed --cursor ./usage.cursor # what follows the cursor's position; the cursor is replaced after
mimicd admin usage history --from 2026-01-01T00:00:00Z --to 2026-01-02T00:00:00Z [--database DB]Over the API, GET /v1/admin/usage/feed?position=&max= (usage.read)
gives at most max intervals past an opaque position and a new position,
so a reader resumes across restarts and across stores. Every line says what
it is (interval, row or gap). A store not answering is named
unreached and keeps its place. Intervals older than usage_retention (35
days by default) are deleted, and a reader behind them is given an
expired gap; a store recovered to an earlier point gives a restored
gap, and the reader replaces what it held of those intervals.
Audit trail
Every administration request that changes something, and every operator
command that does, is an audit entry: its kind (access.create_user,
access.grant_role, metadata.create_database, metadata.set_settings,
access.reset_superuser, a collection's or migration's change, an endpoint's
or trigger's change, an import, a fence, a removal, …), its actor
(user:<name>, key:<id>, or operator:<name>), the database it names, its
parameters (never a password, a key's secret or a document's id) and its
outcome.
- A change made on the home is recorded in the same transaction: there exactly when the change is.
- A change made elsewhere writes an
intendedentry first and its outcome after (applied, a refusal's code, orunknown). - Refusals decided on the records are recorded too.
- Entries are numbered in commit order with no gap, and deleted after
audit_retention(400 days by default).
mimicd admin audit read --from 2026-01-01T00:00:00Z [--actor ACTOR] [--kind KIND] [--database DB]Over the API, GET /v1/admin/audit?from=&to=&after=&limit=&actor=&kind=&database=
(audit.read). What processes do on their own (ACME's renewals, sweeps,
purges) is not audited.
What to alert on
/readyznot200on a process, ormimic_node_ready0.mimic_store_reachable0 for any store.- Any alert line (
mimic_alertsincreasing), and any attention item. mimic_journal_appends{outcome="error"}orambiguousincreasing.mimic_certificate_expiry_timestamp_secondswithin two weeks.mimic_usage_seal_lag_secondsgrowing.- PostgreSQL's disk, replication lag and connections, from PostgreSQL's own metrics.