A sample monitor app

Development env

  1. Setting up env

    make env
  2. Make sure there is an instance of postgres and kafka available

    • There are no particular constraints to the postgres, any 10+ version should work
    • Kafka should have 2 topics:
      • monitoring_checks
      • monitoring_results
  3. Create a copy of config

    cp config.yaml.example config.yaml
    
  4. Set env variable WEBCHECK_CONFIG=config.yaml or any appropriate value with the config file instance

  5. Create db scheme

    make migrate
  6. Run lint

    make lint
  7. Run tests, note that db will be cleared, it is preferable to create a new db instance specifically for tests.

    make test
  8. Once local instance is available, you can try populating it with the initial fixtures

    make fixtures
  9. Now a scheduler could be started in one shell

    make results_worker
  10. In other shell start a worker for making the checks

    make checks_worker
  11. And in another shell start a results handling worker

    make results_worker
  12. In order to see the internals of the db use

    pipenv run webcheckctl --help

    Some shortcuts:

    • make websites-list
    • make checks-list
    • make results-list

Packaging

There is no clearly defined way how to use it, no scripts to build rpm or deb out of the box. But there is a Docker image sample which suggests how the app could be packaged.

make docker-image