A chaos engineering framework for Python Flask applications.
Project description
Proofdock chaos middleware for Flask
Practice chaos engineering on the Flask framework. This project is a Flask contribution to the proofdock-chaos-middleware-python
project.
Project description
This project is part of Proofdock's Chaos Platform that supports you to attack your service application with turbulent and unexpected conditions in order to improve its resiliency.
For more information visit our official website or documentation. Feel free to ask for support for this package on GitHub.
Install
This package requires Python 3.5+
$ pip install -U proofdock-chaos-middleware-flask
Usage
Read the documentation to understand the usage of the chaos middleware project.
Configuration
The chaos middleware for Flask takes the following input variables:
Variable | Description |
---|---|
CHAOS_MIDDLEWARE_APPLICATION_NAME |
The service application's name |
CHAOS_MIDDLEWARE_APPLICATION_ENVIRONMENT |
The service application's deployed environment |
CHAOS_MIDDLEWARE_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for proofdock_chaos_middleware_flask-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24a7b5ba54b0eb9df5ac46d4f1880176d0932fb2b5e12fa14ff1f9a6513bfbd |
|
MD5 | 484de7d2e54462000c871cb0b126c5e6 |
|
BLAKE2b-256 | 5e9a7353747557a9069b7e6d73152ec1485faacf3cfc9ca7e2a5b3bbfca130d1 |