Example web application visualizing SLA adherence based on Kentik synthetic mesh test data
Shell:
export KTAPI_AUTH_EMAIL=<your kentik api email>
export KTAPI_AUTH_TOKEN=<your kentik api token>
./generate_client.sh
pip install -r requirements.txt
python main.py
Shell:
export KTAPI_AUTH_EMAIL=<your kentik api email>
export KTAPI_AUTH_TOKEN=<your kentik api token>
./generate_client.sh
pip install -r requirements.txt
gunicorn --config=data/gunicorn.conf.py 'main:run()'
Shell:
docker build . -t sla_dashboard
Shell:
docker run \
--name sla_dashboard \
--rm \
-e KTAPI_AUTH_EMAIL=<kentik account email> \
-e KTAPI_AUTH_TOKEN=<kentik account token> \
-v "$(pwd)/data:/app/data" \
-p 127.0.0.1:8050:8050 \
sla_dashboard:latest
Note: running the app as docker container requires data/
folder with config.yaml
and gunicorn.conf.py
Configuration is stored in config file config.yaml
Each instance of WebApp maintains it's own data cache.
Running multiple instances of WebApp, for example as WSGI server workers, is safe, but may increase the API request quota impact.
- Prepare virtual environment with
virtualenv venv
- Activate virtual environment with
source venv/bin/activate
- Install requirements with
pip install -r requirements.txt
- (Optionally) Update the local schema as described here
- Generate synthetics client with
generate_client.sh
- Get swagger specification for synthetics from https://github.com/kentik/api-schema-public/tree/master/gen/openapiv2/kentik/synthetics/v202101beta1
- Convert swagger spec to openapi 3 spec using https://mermade.org.uk/openapi-converter
- Save the openapi 3 spec as
synthetics.openapi.yaml
in project root directory