# _health

URL: /pounce/api/_health/
Section: api
Description: Built-in health check endpoint.

Responds to GET and HEAD requests at the configured ``health_check_path`` before
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).

---

> For a complete page index, fetch /pounce/llms.txt.

Open LLM text
(/pounce/api/_health/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_health%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_health%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_health%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2F_health%2Findex.txt)

Module

#
`_health`

Built-in health check endpoint.

Responds to GET and HEAD requests at the configured`health_check_path`before
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).

1Function

## Functions

`build_health_response`

3

`tuple[int, list[tuple[by…`

▼

Build a health check response.

When *draining* is True the response uses HTTP …

`def build_health_response(*, worker_id: int, active_connections: int, draining: bool = False) -> tuple[int, list[tuple[bytes, bytes]], bytes]`

Build a health check response.

When draining is True the response uses HTTP 503 with
`{"status": "draining", ...}`so load balancers stop routing
new traffic while the worker finishes in-flight work.

##### Parameters

Name
Type
Description

`worker_id`
`int`

`active_connections`
`int`

`draining`
`bool`

Default:`False`

##### Returns

`tuple[int, list[tuple[bytes, bytes]], bytes]`
