pico-actuator v0.1.0
First public release. Spring Boot-style actuator endpoints for pico-fastapi apps, auto-discovered by pico-boot — install it and the endpoints appear, zero config. No prior versions; no migration required.
Endpoints
| Endpoint | Purpose |
|---|---|
GET /actuator/health |
Overall status + per-component detail (200/503) |
GET /actuator/health/live |
Liveness — always UP; wire to livenessProbe |
GET /actuator/health/ready |
Readiness — aggregate of all indicators |
GET /actuator/info |
Static config + dynamic contributors |
GET /actuator/metrics |
Prometheus default registry (metrics extra) |
Highlights
- Zero registration: any
@componentsatisfying theHealthIndicator/InfoContributorprotocol is collected viaList[...]injection. - Failure isolation: a raising or hanging indicator reports its own component
DOWN; the endpoint never 500s. - Concurrent checks with per-indicator timeout (
actuator.check_timeout_seconds, default 5s); sync checks run in a worker thread and cannot stall the event loop. - Dependency-free liveness by design: restart storms during dependency outages are impossible.
- Master switch:
actuator.enabled: falsemakes every endpoint answer404. - Composes with pico-otel: OTel metrics land in the registry
/actuator/metricsserves.
Example
from pico_ioc import component
@component
class DbHealth: # satisfies HealthIndicator — no registration needed
name = "db"
def check(self):
self.engine.connect().close()
return {"status": "UP"}$ curl -s localhost:8000/actuator/health
{"status":"UP","components":{"db":{"status":"UP"}}}Compatibility
- Python 3.11+ · pico-ioc >= 2.2.0 · pico-fastapi >= 0.2.0
Tests
- 14 tests. Pinned behaviors: concurrent execution (3 x 0.2s indicators finish in < 0.5s), per-indicator timeout reports
DOWNwithout hanging the endpoint, failure isolation (a raising indicator never 500s),enabled: falsedisables all five routes, exposition validity via the officialprometheus_clientparser, and OpenMetrics content negotiation (# EOFterminator).
Install
pip install pico-actuator # health/info
pip install pico-actuator[metrics] # + Prometheus/OpenMetrics /metrics