Generic Python connector for sending application errors to AuraKeeper's
POST /v1/logs/errors endpoint.
- Automatic process-level capture with
sys.excepthook - Automatic thread-level capture with
threading.excepthook - Manual capture for handled exceptions and messages
- Payloads normalized to the schema in
openapi.yaml - No external dependencies
aurakeeper/: installable connector packageexamples/: standalone setup example
pip install ./connectors/pythonfrom aurakeeper import create_aurakeeper_connector
connector = create_aurakeeper_connector(
endpoint="https://api.example.com/v1/logs/errors",
api_token="your-api-token",
service_name="python-worker",
service_version="1.0.0",
environment="production",
framework="fastapi",
component="billing",
tags=["backend"],
)
connector.install()
try:
raise ValueError("Handled Python error")
except ValueError as error:
future = connector.capture_exception(
error,
handled=True,
level="error",
correlation_id="job_123",
details={"job_name": "reconcile-payments"},
)
future.result()
connector.flush()
connector.close()endpoint: Full AuraKeeper ingestion URLapi_token: API token sent asX-API-Tokenservice_name: Required logical service nameservice_version: Optional application version or build idenvironment: Optional environment such asproductionplatform_name: Optional override forbackend,worker,cli, etc.framework: Optional framework name included insource.frameworkcomponent: Optional component name included insource.componentinstance_id: Optional service instance identifiertags: Optional tags appended tocontext.tagscontext: Optional shared context merged into every eventheaders: Optional additional HTTP headerstimeout: Request timeout in seconds for the default transporttransport: Optional custom transport callablebefore_send: Optional hook to mutate or drop a payload before it is senton_transport_error: Optional callback used by automatic hook capturecapture_uncaught: Disablesys.excepthookcapture withFalsecapture_threads: Disablethreading.excepthookcapture withFalse
capture_exception()andcapture_message()submit work in a thread pool and return aFuture.flush()waits for all in-flight sends and returns settled statuses similar to JavaScript'sPromise.allSettled().close()optionally waits for in-flight work, restores hooks, and shuts down the thread pool.- The transport callable receives a config dictionary with
endpoint,api_token,apiToken,payload,headers, andtimeout. - Full example setup is available in
examples/standalone.