Skip to main content

Python package fo generating diagnostic endpoint for flask based python web applications.

Project description

Diagnostics Endpoint

Library to generate diagnostics endpoint for flask based python web applications.


Installation from PyPi

this package can be installed from PyPi using pip :

pip install -U diagnostics-endpoint

Installation from Github

Install this package directly from github:

pip install -U git+ssh://


  1. Add the dependency in requirements.txt.
  1. Add the below line to your application entry point:
from diagnostics_endpoint import Diagnostics

application_endpoints = [
    {"name": "API - Test Service", "endpoint": "http://my-api"},
    {"name": "Upstream - UpStream API", "endpoint": "https://my-upstream-api"},
    {"name": "Downstream - DownStream API", "endpoint": "https://my-downstream-api"},
    {"name": "Database - MyDatabase", "endpoint": "tcp://my-database-host:my-database-port"}

app = Flask(__name__)
Diagnostics.render(app, application_endpoints)

This will generate two endpoints :

  1. /diagnostics as

alt text

  1. /heartbeat with response as Ok


diagnostics-endpoints supports configuration via Diagnostics.render() method.

Set Application Endpoints

Diagnostics.render() method takes a list of dictionaries of application endpoints. Format of the dictionary is :

application_endpoints = [{"name": "API Name","endpoint": "API URL"}]

here endpoint can be a http, https or tcp endpoint. You can also give absolute URLs as well by giving the url directly as /user. Example:

application_endpoints = [
                            {"name": "My API Endpoint","endpoint": "/hello"},
                            {"name":"My HTTP Endpoint","endpoint":""},
                            {"name":"My HTTPS Endpoint","endpoint":""},
                            {"name":"My TCP Database Endpoint","endpoint":"tcp://my-database-host:3306"}    

Set Application Root

you can specify application root path as:

Diagnostics.render(app, application_endpoints, "/myapplication")

This will generate the two endpoints as /myapplication/diagnostics and /myapplication/heartbeat.

Python Diagnostics History

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

diagnostics-endpoint-0.0.8.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

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