Transport-neutral actuator health and info contracts for Spakky Framework
Project description
Spakky Actuator
Transport-neutral actuator contracts for Spakky Framework.
Installation
pip install spakky-actuator
Features
- Health, readiness, liveness results: Shared result contracts for HTTP, CLI, or other adapters
- Probe extension points: Sync and async health probes registered through Spakky DI
- Info contributors: Deterministic merge of sync and async info contributors
- Exception handling: Probe exceptions become unhealthy component results with structured error details
- Transport-neutral core: No FastAPI, Typer, or plugin adapter dependency
Endpoint Semantics
| Surface | Meaning | Default behavior |
|---|---|---|
health |
Aggregate application health for operator-facing status checks | Evaluates probes whose endpoints include ActuatorEndpoint.HEALTH |
readiness |
Whether the app is ready to serve traffic or work | Evaluates readiness probes; required unhealthy probes make the result unhealthy |
liveness |
Whether the process/framework is alive | Separate from external dependency readiness; no custom liveness probes returns a healthy baseline |
info |
Deterministic application metadata | Merges registered info contributors by contributor name |
By default, health probes participate in health and readiness, not liveness.
Use ActuatorEndpoint.LIVENESS only for process-local checks that should not fail because an external dependency is unavailable.
Quick Start
from spakky.actuator import (
AbstractHealthProbe,
ActuatorAggregationService,
ActuatorExtensionRegistry,
ComponentHealthResult,
)
class DatabaseProbe(AbstractHealthProbe):
@property
def name(self) -> str:
return "database"
def check(self) -> ComponentHealthResult:
return ComponentHealthResult.healthy(self.name)
registry = ActuatorExtensionRegistry()
registry.register_health_probe(DatabaseProbe())
service = ActuatorAggregationService(registry)
health = service.evaluate_health()
readiness = service.evaluate_readiness()
Extension Points
Register AbstractHealthProbe or AbstractAsyncHealthProbe Pods to contribute component health.
Register IInfoContributor or IAsyncInfoContributor Pods to contribute metadata to info.
The actuator plugin adds ActuatorExtensionPostProcessor, which discovers those Pods and stores them in ActuatorExtensionRegistry.
from spakky.actuator import (
AbstractHealthProbe,
IInfoContributor,
ActuatorEndpoint,
ComponentHealthResult,
)
class ProcessProbe(AbstractHealthProbe):
@property
def name(self) -> str:
return "process"
@property
def endpoints(self) -> tuple[ActuatorEndpoint, ...]:
return (ActuatorEndpoint.LIVENESS,)
def check(self) -> ComponentHealthResult:
return ComponentHealthResult.healthy(self.name)
class BuildInfo(IInfoContributor):
@property
def name(self) -> str:
return "build"
def contribute_info(self) -> dict[str, object]:
return {"version": "1.0.0"}
Plugin-specific deep checks for SQLAlchemy, Kafka, RabbitMQ, Celery, or other integrations are intentionally not included in this milestone. Applications can add those checks as first-party probes without changing the transport adapters.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spakky_actuator-6.3.1.tar.gz.
File metadata
- Download URL: spakky_actuator-6.3.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4efa8127c06289b6d34dc9d7f20252184b5a1c71aaa3ab6ac1ca2b4f3020d0a9
|
|
| MD5 |
a9fc0b3ddf17b1d112f55e818216d97f
|
|
| BLAKE2b-256 |
164ccd0609f9d311389c780be0d89e37e9ee543c42f065149a88e702259c7cf3
|
Provenance
The following attestation bundles were made for spakky_actuator-6.3.1.tar.gz:
Publisher:
publish-package.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_actuator-6.3.1.tar.gz -
Subject digest:
4efa8127c06289b6d34dc9d7f20252184b5a1c71aaa3ab6ac1ca2b4f3020d0a9 - Sigstore transparency entry: 1435892024
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file spakky_actuator-6.3.1-py3-none-any.whl.
File metadata
- Download URL: spakky_actuator-6.3.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38a2332a80baefec846864a85964641d94a8adf92451a8902c86a79e20b44197
|
|
| MD5 |
4640e48ff0aa7c35eb692710cdb88fd2
|
|
| BLAKE2b-256 |
4b6a72ff7e436b677d31f97ac0ed4b1e753e7c17632f9b93f578a2bf2a77f2fe
|
Provenance
The following attestation bundles were made for spakky_actuator-6.3.1-py3-none-any.whl:
Publisher:
publish-package.yml on E5presso/spakky-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spakky_actuator-6.3.1-py3-none-any.whl -
Subject digest:
38a2332a80baefec846864a85964641d94a8adf92451a8902c86a79e20b44197 - Sigstore transparency entry: 1435892026
- Sigstore integration time:
-
Permalink:
E5presso/spakky-framework@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/E5presso
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@9b55f2f729fb6e6397bbf0d1ce584eaec72ffef8 -
Trigger Event:
workflow_dispatch
-
Statement type: