Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spakky_actuator-6.4.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spakky_actuator-6.4.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file spakky_actuator-6.4.0.tar.gz.

File metadata

  • Download URL: spakky_actuator-6.4.0.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

Hashes for spakky_actuator-6.4.0.tar.gz
Algorithm Hash digest
SHA256 49eda6e72dbb3d99cf2693e9dfa7413e2714993b589f5646eddb5c2d7a75f144
MD5 9d15f181b70c2f4d2ee70f3085ccfaee
BLAKE2b-256 faada939a9c5740298472e038d6710655594228e1c92c32dd3e269da6e654523

See more details on using hashes here.

Provenance

The following attestation bundles were made for spakky_actuator-6.4.0.tar.gz:

Publisher: release.yml on E5presso/spakky-framework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spakky_actuator-6.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for spakky_actuator-6.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee7408e5e385e138fbf34535d5013749c2143f4a788f0c2bb2090ba4ac100c58
MD5 a39475eaec9bd98db8f2cc8c6f13c36d
BLAKE2b-256 a769539f48cec2cdbc976b9ceb46d5c38efeb434ad3c7859300ee27f9cea09f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for spakky_actuator-6.4.0-py3-none-any.whl:

Publisher: release.yml on E5presso/spakky-framework

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page