Health Checks
Health checks are mounted at the repository root, not under /api/v1.
Both primary and follower nodes register this group.
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
GET / HEAD | /health | Liveness check |
GET / HEAD | /health/ready | Readiness check covering the database, setup state, and lightweight prerequisites for the active node mode |
GET | /health/memory | Heap statistics, registered only in debug_assertions + openapi builds |
GET | /health/metrics | Prometheus metrics; requires the metrics feature and explicit [observability.prometheus].enabled = true |
GET /health
Section titled “GET /health”Typical response:
{ "code": "success", "msg": "", "data": { "status": "ok", "version": "0.0.0", "build_time": "2026-03-22T00:00:00Z" }}build_time comes from the compile-time ASTER_BUILD_TIME environment variable. When the
variable is unset, the build script falls back to the current UTC time.
HEAD /health has the same semantics, but returns no body.
GET /health/ready
Section titled “GET /health/ready”This endpoint does more than a database ping. It checks the database and the active cache backend for every deployment profile. The single profile remains ready when an unavailable configured remote cache falls back to a healthy memory cache, while diagnostics report that state as degraded. Shared-runtime profiles require both the configured and active backend to be Redis. It then continues according to node mode:
primary: validates dynamic cluster topology and the authoritative setup state.needs_adminandneeds_storagereturn200immediately; onlyreadyrequires a default storage policy, a constructible driver, and that driver’s lightweight readiness checkfollower: checks the follower’s active storage driver and the state required for binding
This endpoint is meant to stay cheap. It does not perform remote S3 or remote-storage read/write/delete probes. Use the admin policy “test connection” action when you need to verify object storage credentials or permissions.
Successful primary responses use one of three data.status values:
needs_admin:200; base dependencies are healthy, but the first administrator does not existneeds_storage:200; an administrator exists, but the default storage policy group or administrator assignment is incompleteready:200; product setup is complete and the default driver’s lightweight readiness check passed
Error responses:
- database unavailable:
503withDatabase unavailable - an unhealthy active cache:
503withCache unavailable; in cluster deployments, an active backend that differs from configuration also returns503, and both the configured and active backend must be Redis - invalid cluster topology, missing default policy, driver-construction failure, or lightweight readiness failure:
503withStorage unavailable
Recommended deployment usage:
/healthfor liveness / basic probing/health/readyfor Kubernetes readiness; final launch validation must also requiredata.status = "ready"
GET /health/memory
Section titled “GET /health/memory”Only debug_assertions + openapi builds register this endpoint.
It reports current heap allocation and peak usage as MB strings.
GET /health/metrics
Section titled “GET /health/metrics”Requires the metrics feature and explicit [observability.prometheus].enabled = true; disabled by default. Output is Prometheus text exposition.
If you need metrics, build with:
cargo build --release --features metricsor:
cargo build --release --features fullDedicated static Basic Auth lives under [observability.prometheus.basic_auth]; see Monitoring for configuration, verifier generation, environment overrides and scraping. Primary/follower apply the same authentication before export/503, use no-store, and leave health/readiness unaffected. Missing, malformed, duplicate and incorrect credentials receive a uniform 401 + Basic challenge. Builds without pull capability and OTLP-only deployments do not register this endpoint.
Current metrics
Section titled “Current metrics”HTTP and database:
| Metric | Labels | Notes |
|---|---|---|
http_requests_total | method, route, status | Request count |
http_request_duration_seconds | method, route, status | Request latency histogram |
db_queries_total | backend, kind, status | SeaORM query count |
db_query_duration_seconds | backend, kind, status | SeaORM query latency histogram |
Auth, upload, download, and tasks:
| Metric | Labels | Notes |
|---|---|---|
auth_events_total | action, status, reason | Login and refresh-token events |
file_uploads_total | mode, status | Upload outcomes across direct / chunked / presigned modes |
file_downloads_total | source, outcome, range | Download outcomes |
upload_sessions_total | mode | Created upload sessions |
upload_session_events_total | mode, event, status | Session lifecycle events |
background_tasks_total | kind, status | Task state transitions |
background_task_retries_total | kind | Retry count |
background_tasks_pending | none | Current Pending / Retry backlog |
Storage drivers:
| Metric | Labels | Notes |
|---|---|---|
storage_driver_operations_total | driver, operation, status, kind | Driver operations |
storage_driver_operation_duration_seconds | driver, operation, status, kind | Driver latency histogram |
Process metrics:
| Metric | Labels | Notes |
|---|---|---|
process_memory_rss_bytes | none | Resident set size |
process_cpu_milliseconds_total | none | Total CPU time in milliseconds |
process_uptime_seconds | none | Uptime since metrics initialization |
process_cpu_milliseconds_total is already exposed in milliseconds. process_uptime_seconds is monotonic rather than epoch-based.
Product lifecycle metrics
Section titled “Product lifecycle metrics”The current schema is defined once in crates/aster_drive_metrics/src/lib.rs. Its pre-instance compatibility fixture preserves all prior product names, types, HELP, labels and buckets. New metrics cover actual body bytes, stream EOF/error/drop duration and in-flight counts; upload phases and persisted session backlog; capacity/support snapshots and admission rejection reasons; stored-blob cleanup backlog and retired backing bytes; remote probe state, tunnel lanes/reconnects and wire requests.
source=remote is follower-observed data-plane I/O and must not be added to primary user boundaries. Presigned/redirect flows bypassing AD have no fabricated bytes; AD followers carrying remote-presigned traffic do count their own observed bytes. Transfer bytes exclude TLS/HTTP framing. Completed upload replays do not recount phases. Cleanup retirement bytes are acknowledged backing accounting after row removal, not physical disk blocks; the independent pending timestamp survives retries and clears on referencing. Existing pending timestamps are backfilled from updated_at at upgrade.
Primary aggregates run every 60 seconds with a five-second DB budget; follower does not query primary backlog. Scrape does no business I/O. Filter snapshots by observability_snapshot_valid and a last-success age below 180 seconds. Capacity values require storage_capacity_known == 1; unsupported/unknown is not zero. observed_target_minimum contains independent minima over recent existing probe-cache observations, not summed or comparable numerator/denominator values. Staging filesystem usage includes the entire volume, while upload_staging_bytes explicitly reports declared/staged reservations and safety floor.
See the Chinese metric contract for the full type/unit/label table and runnable PromQL for throughput, failures, phase p95, backlog age, capacity and tunnel errors. P1 workspace quota aggregates and dedicated protocol-operation metrics remain follow-up work; tracing/Tempo is outside this metrics batch.