How it is built
Seven services in Rust talking over Redis Streams, a React console, Postgres for what must survive, and Kubernetes as the thing being repaired.
The services
| Service | Job |
|---|---|
| ingestion | Polls Prometheus and accepts pushed events |
| correlation | Detects anomalies and groups them into incidents |
| rca | Proposes causes and ranks runbooks |
| action | Runs the checks, waits for approval, acts and verifies |
| governance | Permissions, approvals, audit, runbook registry |
| feedback | Labels outcomes, graduates and demotes runbooks |
| read | Builds what the console shows, streamed live |
Rebuilt from Python
Both versions were measured with one script on the same laptop, on fresh containers, twice each.
| Measure | Python | Rust |
|---|---|---|
| Most service images | 495 MiB | 42 to 54 MiB |
| Correlation and action images | 3,916 MiB | 42 and 54 MiB |
| RCA image | 495 MiB, without the model | 219 MiB, with it |
| Idle memory, seven services | 486 to 507 MiB | 111 MiB |
| Events accepted per second | 1,763 to 2,617 | 18,282 to 20,000 |
| Events through detection per second | 1,195 to 1,877 | 10,235 to 10,241 |
| Slowest 1% of ingest batches | 156 to 234 ms | 31 to 32 ms |
| Start-up to ready | 2.6 to 5.6 s | 1.8 to 5.4 s |
Part of the throughput gain is publishing in batches, which Python could also have done. Start-up and the time from fault to incident did not meaningfully change. The multi-gigabyte Python images were mostly machine learning libraries.
What it cost
The first image build takes several minutes, there is no River or scikit-learn so the isolation forest was written by hand, and trying a new model is slower than in Python.
Keeping the behaviour
Before any Python was removed its behaviour was recorded, and the Rust tests replay it: 20,800 correlation operations, 9,000 detector samples, 2,500 remediation gate cases, 600 health checks, 3,015 permission matches and 400 diagnoses. The original is kept on the python-legacy branch.
Bugs the rebuild found
- Rolling back to a revision did not roll back: the old pod template was merged into the new one.
- An approval landing as the wait ended was recorded as approved while the outcome said it timed out.
- Embedding-based runbook selection never ran in the default stack.
- One malformed event published half of its batch.