This is a Flask based playground application for a Riemann workshop. The point is to have some application we can experiment on to generate metrics and events for Riemann.
The behaviour of this application can be pretty bad, which is very good for the workshop... don't take it as an example of a well-written application.
For python requirements, see the requirements.txt
file or just use pip install -r requirements.txt
Other then that the application depends on CouchDB and Riemann.
To specify a config file, set the APP_CONFIG_FILE
environment variable to name of a python config file. Here is a list of configuration variables and their defaults:
- COUCHDB_DATABASE="insults",
- COUCHDB_SERVER="http://localhost:5984",
- RIEMANN_ADDRESS="localhost:5555"
- BASE_URL="http://localhost:5000" - base url for swagger. For use with WSGI servers or proxies
To start the development server simply run app.py:
python app.py
To run with a production grade WSGI server (e.g. gunicorn):
gunicorn -w 2 -e APP_CONFIG_FILE=config.py -b :8080 app:app
Now go to the swagger UI URL: http://localhost:5000/api/spec.html
In the db
folder there is a list file containing insult documents. To populate the database use the import tools:
python db/import.py -u http://localhost:5984/insults db/insults.list
This application uses the following Open Source libraries
- Flask
- flask-restful
- flask-restful-swagger (by Ran Tavory)
- flask-couchdb
- python-couchdb
- Bernhard Riemann client