Skip to main content

A chaos engineering framework for Python Flask applications.

Project description

Chaos Middleware Flask integration

CI Python versions

Install

This package requires Python 3.5+

$ pip install -U proofdock-chaos-middleware-flask

Usage

The chaos middleware for Flask takes the following input variables:

Variable Description
CHAOS_MIDDLEWARE_APPLICATION_NAME The service application's name
CHAOS_MIDDLEWARE_APPLICATION_ENV The service application's deployed environment
CHAOS_MIDDLEWARE_PROOFDOCK_API_TOKEN The API token to connect to Proofdock's Chaos API

The configuration exemplified as code:

from flask import Flask, jsonify
from pdchaos.middleware.contrib.flask.flask_middleware import FlaskMiddleware

app = Flask(__name__)
app.config['CHAOS_MIDDLEWARE_APPLICATION_NAME'] = 'example-application-name'
app.config['CHAOS_MIDDLEWARE_APPLICATION_ENV'] = 'example-environment'
app.config['CHAOS_MIDDLEWARE_PROOFDOCK_API_TOKEN'] = 'eyJ0eXAi...05'

middleware = FlaskMiddleware(app)

# Your business logic here

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

References

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file proofdock_chaos_middleware_flask-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: proofdock_chaos_middleware_flask-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for proofdock_chaos_middleware_flask-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 935a06583c30ec6bbc73a32614598803109047665cac0e34022b3571be7c5f5d
MD5 94a0fe69d8457c97eefe7446ac6938f6
BLAKE2b-256 f0f077462ed687c7499a500e5451d48a45e295bfe761345390eea47c8d580d51

See more details on using hashes here.

Supported by

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