Runbook¶
How-to guideThe steps for one task.
What an operator needs on the day something happens. Everything here was exercised in the release test run; the behaviours are tested, not assumed.
What to back up¶
| Store | Backup | Notes |
|---|---|---|
| SQLite (default) | Copy apinx.db while the process runs; WAL mode keeps the copy consistent. analytics.db is rollups with bounded retention; losing it loses history only |
|
| PostgreSQL | pg_dump while serving |
Configuration and rollups are in the same database |
| The master key | Wherever you keep production secrets (one key for every instance in cluster.mode: ha) |
A backup is the database plus the master key. Restoring the database without the key that encrypted its secrets leaves API-key material, backend credentials and identity-provider secrets unreadable, by design |
Restore: stop, restore the database, start with the same APINX_SECURITY_MASTER_KEY. A second
instance on a restored database serves the same APIs, keys, subscriptions and quota state.
Upgrades¶
Stop, replace the binary or image, start. Schema migrations run at start and are forward-only;
take a backup first. In-flight requests drain within shutdown.drain_timeout (30 s by default).
Configuration exported by one version imports into the next unchanged.
When the database is down¶
Traffic is unaffected: deployed APIs, API keys, rate limits, quotas and caches keep working from memory. What changes:
/readyz |
503, "store": "the configuration store cannot be reached" |
| Console and Admin API | 503 APX-CP-0026; sessions survive; the console explains and retries every ten seconds |
| Quota counters | Kept in memory and flushed when the store returns |
| Analytics | Aggregates kept in memory (bounded at about 10 MB) and flushed when the store returns |
| Audit | Changes are refused while the store is down, so nothing goes unrecorded |
When the store returns, everything recovers without a restart.
When a backend is down¶
Upstream health checks eject failing targets, the circuit breaker opens after repeated failures
and retries follow the upstream's rules. Callers get 502 or 503 with an APX-UP- code that names
the cause; the trace shows every attempt. Nothing needs restarting when the backend returns.
Rotating secrets¶
| What | How |
|---|---|
| Master key | Set the new key, name the old one as security.previous_master_key (or _file) for one start; data keys are re-wrapped; remove the old setting |
| Data keys | Admin → Encryption keys → Rotate, on any instance. Every stored secret is re-encrypted under the new key at once and every instance seals under it from its next save. The old key is listed as Retired, kept for a day so that a form open during the rotation can still be saved, then deleted |
| A consumer's API key | Consumers → Rotate with an overlap window, then revoke the old one |
A backend credential in upstream-auth |
Edit the policy and deploy; the next token fetch uses it |
| A console user's password | Users → Reset password, which also clears a lockout |
Users and access¶
Three roles: administrators manage everything; editors change configuration but not users, security, sign-in or flow hooks; viewers read. Five failed sign-ins lock an account for fifteen minutes; during the lock every attempt is refused as a wrong password is, the right one included, and a password reset ends it. Disabling a user ends their sessions at once. The console can sign users in through your OIDC provider with role mapping by claim; local passwords can be limited to a break-glass administrator.
Capacity and retention¶
-
Whether the server turns callers away: Admin › About › Capacity, the gateway's sockets, the kernel, the network and nginx in one card, every 10 seconds.
-
Analytics retention per granularity:
analytics.retention.minute(default 48 h),.hour(30 d),.day(400 d). Watchrollup_minuterow counts in the first days. - Request inspector:
inspector.capacityentries andinspector.retention; bodies only while debugging. - Telemetry bus:
apinx_telemetry_dropped_totalshould stay at zero; it did over 2.3 million requests in the release run.
Signals worth alerting on¶
| Signal | Meaning |
|---|---|
/readyz 503 |
The store or the gateway configuration is unavailable |
apinx_telemetry_dropped_total rising |
The machine is saturated; analytics and traces are incomplete |
APX-UP- rejections rising |
A backend is failing |
APX-PL-0026 |
The gateway cannot obtain a backend token |
Log line analytics flush failed |
The store rejects writes; rows are kept and retried |
apinx_listener_full_total rising |
A listener reached max_connections: new callers queue, then drop |
apinx_listener_accept_errors_total rising |
Accepts fail, most often too many open files (LimitNOFILE) |
Log line capacity: … is dropping |
Connections or packets were lost; Admin › About › Capacity shows where |
Ports and exposure¶
The proxy port carries customer traffic. The console port is the Admin API: keep it on a private
interface or behind a TLS reverse proxy, never on the same public address as the proxy. The
console cookie is Secure over TLS, HttpOnly, and state-changing requests need the
X-Requested-With: Apinx header, so a browser on another site cannot act on your session.