Skip to main content

Healthchecks for upstream dependencies of a Flask app

Project description

flask-keepincheck

Flask extension that implements healthchecks for application's upstream dependencies

Usage

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_keepincheck import HealthCheck

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = ''
db = SQLAlchemy(app)
healthcheck = HealthCheck()
healthcheck.add_db_check(app=app, db=db)

class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)

    def __repr__(self):
        return '<User %r>' % self.username

@app.route('/')
def hello_world():
    return 'Hello, World!'

After this your db's healthcheck can be found at /dbhealth

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Keepincheck-0.1.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

Flask_Keepincheck-0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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