Skip to main content

Simple Django app/framework to publish health checks

Project description

Simple Django app/framework to publish health check for monitoring purposes

Status

https://travis-ci.org/mvantellingen/django-healthchecks.svg?branch=master http://codecov.io/github/mvantellingen/django-healthchecks/coverage.svg?branch=master https://img.shields.io/pypi/v/django-healthchecks.svg

Installation

pip install django_healthchecks

Usage

Add the following to your urls.py:

url(r'^healthchecks/', include('django_healthchecks.urls')),

Add a setting with the available healthchecks:

HEALTH_CHECKS = {
    'postgresql': 'django_healthchecks.contrib.check_database',
    'cache_default': 'django_healthchecks.contrib.check_cache_default',
    'solr': 'your_project.lib.healthchecks.check_solr',
}

You can also include healthchecks over http. This is useful when you want to monitor if depending services are up:

HEALTH_CHECKS = {
    ...
    'my_microservice': 'https://my-service.services.internal/healthchecks/',
    ...
}

By default, http health checks will time out after 500ms. You can override this as follows:

HEALTH_CHECKS_HTTP_TIMEOUT = 0.5

By default the status code is always 200, you can change this to something else by using the HEALTH_CHECKS_ERROR_CODE setting:

HEALTH_CHECKS_ERROR_CODE = 503

You can also add some simple protection to your healthchecks via basic auth. This can be specified per check or a wildcard can be used *.

HEALTH_CHECKS_BASIC_AUTH = {
    '*': [('admin', 'pass')],
    'solr': [],
}

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

django-healthchecks-1.4.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

django_healthchecks-1.4.1-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-healthchecks-1.4.1.tar.gz.

File metadata

File hashes

Hashes for django-healthchecks-1.4.1.tar.gz
Algorithm Hash digest
SHA256 5eb644acfa5b48ca42a62f81c27a74e34ad3006746d1b7b6919d945e3ac22fe2
MD5 5efa0b01bd9d0ff772c07a39984534b6
BLAKE2b-256 9e4a757bc0ae7a6e43f8495211944d9ce85b14ea1e4b0aa01c5f8b9a35f0ff4a

See more details on using hashes here.

File details

Details for the file django_healthchecks-1.4.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_healthchecks-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5d3671e08b06d8ccf210dd91e27554bba955d29e6b80f2c738b979af78ece09c
MD5 bc52e9f37f9cc0871c8bd9137538f2ef
BLAKE2b-256 a1010cc15be6fdec486d4a23dac3960853b4a1ac44a72e49e74322b820fc3051

See more details on using hashes here.

Supported by

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