Checks
Django Built-in Services
health_check.Cache
dataclass
Bases: HealthCheck
Check that the cache backend is able to set and get a value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alias
|
str
|
The cache alias to test against. |
'default'
|
Source code in health_check/cache/backends.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
health_check.Database
dataclass
Bases: HealthCheck
Check database connectivity by executing a simple SELECT 1 query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alias
|
str
|
The alias of the database connection to check. |
'default'
|
Source code in health_check/contrib/db_heartbeat/backends.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
health_check.Disk
dataclass
Bases: HealthCheck
Check system disk usage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Path to check disk usage for. |
getcwd()
|
max_disk_usage_percent
|
float | None
|
Maximum disk usage in percent or None to disable the check. |
HEALTH_CHECK['DISK_USAGE_MAX']
|
Source code in health_check/contrib/psutil/backends.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
health_check.Mail
dataclass
Bases: HealthCheck
Check that mail backend is able to open and close connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend
|
str
|
The email backend to test against. |
EMAIL_BACKEND
|
timeout
|
timedelta
|
Timeout for connection to mail server. |
timedelta(seconds=get('MAIL_TIMEOUT', 15))
|
Source code in health_check/contrib/mail/backends.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
health_check.Memory
dataclass
Bases: HealthCheck
Check system memory usage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_gibibytes_available
|
float | None
|
Minimum available memory in gibibytes or None to disable the check. |
None
|
max_memory_usage_percent
|
float | None
|
Maximum memory usage in percent or None to disable the check. |
90.0
|
Source code in health_check/contrib/psutil/backends.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
health_check.Storage
dataclass
Bases: HealthCheck
Check file storage backends by saving, reading, and deleting a test file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alias
|
str
|
The alias of the storage backend to check. Defaults to "default". |
'default'
|
Source code in health_check/storage/backends.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
3rd Party Services
To use the checks, you will need to install and set up their corresponding dependencies.
health_check.contrib.celery.Ping
dataclass
Bases: HealthCheck
Check Celery worker availability using the ping control command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
timedelta
|
Timeout duration for the ping command. |
timedelta(seconds=getattr(settings, 'HEALTHCHECK_CELERY_PING_TIMEOUT', 1))
|
Source code in health_check/contrib/celery_ping/backends.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
health_check.contrib.rabbitmq.RabbitMQ
dataclass
Bases: HealthCheck
Check RabbitMQ service by opening and closing a broker channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
namespace
|
str
|
Optional namespace for the broker URL setting. |
None
|
Source code in health_check/contrib/rabbitmq/backends.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
health_check.contrib.redis.Redis
dataclass
Bases: HealthCheck
Check Redis service by pinging the redis instance with a redis connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
redis_url
|
str
|
The Redis connection URL. |
getattr(settings, 'REDIS_URL', 'redis://localhost/1')
|
redis_url_options
|
dict[str, Any]
|
Additional options for the Redis connection. |
getattr(settings, 'HEALTHCHECK_REDIS_URL_OPTIONS', None)
|
Source code in health_check/contrib/redis/backends.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |