Skip to content

Example web application visualizing SLA adherence based on Kentik synthetic mesh test data

License

Notifications You must be signed in to change notification settings

jkukuryk/sla_dashboard_webapp

 
 

Repository files navigation

SLA Dashboard web application

Example web application visualizing SLA adherence based on Kentik synthetic mesh test data

Run the dashboard app (development server, debug mode ON)

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

Run the dashboard app (production server, debug mode OFF)

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()'

Docker build image

Shell:

docker build . -t sla_dashboard

Docker run image

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

Application configuration

Configuration is stored in config file config.yaml

API request quota utilisation

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.

Development

  1. Prepare virtual environment with virtualenv venv
  2. Activate virtual environment with source venv/bin/activate
  3. Install requirements with pip install -r requirements.txt
  4. (Optionally) Update the local schema as described here
  5. Generate synthetics client with generate_client.sh

Updating the local schema

  1. Get swagger specification for synthetics from https://github.com/kentik/api-schema-public/tree/master/gen/openapiv2/kentik/synthetics/v202101beta1
  2. Convert swagger spec to openapi 3 spec using https://mermade.org.uk/openapi-converter
  3. Save the openapi 3 spec as synthetics.openapi.yaml in project root directory

About

Example web application visualizing SLA adherence based on Kentik synthetic mesh test data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 83.5%
  • CSS 9.9%
  • Shell 3.2%
  • JavaScript 1.9%
  • Dockerfile 1.5%