Module

_health

Built-in health check endpoint.

Responds to GET requests at the configuredhealth_check_pathbefore the request reaches the ASGI application. Returns a JSON payload with server status, uptime, active connections, and worker identity.

Skips access logging by default (health checks are noisy in production).

Functions

build_health_response 2 tuple[int, list[tuple[by…
Build a health check response.
def build_health_response(*, worker_id: int, active_connections: int) -> tuple[int, list[tuple[bytes, bytes]], bytes]
Parameters
Name Type Description
worker_id int
active_connections int
Returns
tuple[int, list[tuple[bytes, bytes]], bytes]