Skip to main content

Adds some common health check endpoints (ping, time, status)

Project description

Django-Health-Checks

Django-Health-Checks is Django plugin which adds a few health check endpoints (ping, time, and status) to the Django project.

Add health_checks to your settings.py INSTALLED_APPS

INSTALLED_APPS += ('health_checks',)

Add health_checks urls

import health_checks

urlpatterns += [
    url('r^', include('health_checks.urls')),
]

Add some custom status jobs

from health_checks import status_job

@status_job(name="PostgreSQL", timeout=5)
def postgresql():
    # Perform a ping/query to Postgres

@status_job
def facebook
    # Ping some Facebook service.
You now have the below endpoints:
  • /ping/ (returns a 200 “pong”)

  • /time/

    {
      "epoch": 1.463770977e+09,
      "local": "2016-05-20T19:02:57.558686471Z",
      "offset": 0,
      "utc": "2016-05-20T19:02:57.558686471Z",
      "zone": "UTC"
    }
  • /status/

    {
      "endpoints": [
        {
          "duration": 0.028509,
          "endpoint": "PostgreSQL"
        }, {
          "duration": 0.018747,
          "endpoint": "facebook",
          "error": "socket.gaierror: [Errno -2] Name or service not known"
        },
        ...
    }

get Django-Health-Checks

Install django

easy_install django-health-checks
or
pip install django-health-checks

Download the latest release from Python Package Index or clone the repository

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-Health-Checks-0.0.1.tar.gz (4.3 kB view hashes)

Uploaded Source

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