Expand description
The periodic line that says what the deployment currently holds, and the
state behind GET /health’s progress report.
The development stack is operated by watching its log. Provisioning and record writes each announce themselves as they happen, but a developer who attaches to a quiet server sees nothing at all, and a developer scrolling back through a busy one has no marker to count against. One line every ten seconds fixes both: it is a heartbeat and a running total in the same place.
§Liveness versus progress
A process that answers HTTP is not the same claim as one whose log is
advancing: a deadlocked lock, a registry stuck retrying a poisoned mutex,
or a runtime with every worker parked behind a hung syscall can all leave
axum answering 200 while nothing this tick would log is happening
underneath it. HealthState is what lets GET /health say more than
“a socket accepted” — it is the tick’s own pulse, read back rather than
re-derived, so the two can never disagree about whether the tick that
is the deployment’s sign of life is still ticking.
GET /health itself stays the liveness check: it answers 200 whenever
this process can schedule a task at all, which is what a load balancer
should gate traffic on. progress in its body is the second claim,
carried in the same response rather than a separate route, so a caller
that only wants liveness reads one field and a caller diagnosing a stall
reads the rest of the same document.
Structs§
- Certificate
Health - What
GET /healthreports about certificate renewal. - Disk
Health - What
GET /healthreports about the data volume. - Disk
Watermarks - The free space, as a percentage of the data volume, below which
GET /health’sdisk.alertand the journal raise an alert. The[capacity] disk_*_free_percentkeys set them. - Health
Snapshot - What
GET /healthreports beyond liveness: whether the tick that logs this deployment’s own pulse is still advancing, and how recently. - Health
State - The tick’s pulse, shared with whoever answers
GET /health. - Health
Tick - A running health tick, stopped by
HealthTick::stopor by dropping it. - Zone
Certificate Health - One zone’s entry in
CertificateHealth::zones.
Enums§
- Disk
Alert - Which free-space watermark the data volume is below.
Constants§
- DEFAULT_
HEALTH_ INTERVAL - How often the health line is written when a caller does not choose.
- REVISION 🔒
- The commit this binary was built from, as
scripts/publish-image.shpasses it to the image build inDIDBOT_REVISION.Nonefor a build that was not given one, such ascargo run.
Traits§
- Certificate
Alerts - Reads back each zone’s certificate alert level.
Functions§
- log_
stats 🔒 - Writes one health line.