A sample monitor app
Development env
-
Setting up env
make env
-
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
-
Create a copy of config
cp config.yaml.example config.yaml
-
Set env variable
WEBCHECK_CONFIG=config.yaml
or any appropriate value with the config file instance -
Create db scheme
make migrate
-
Run lint
make lint
-
Run tests, note that db will be cleared, it is preferable to create a new db instance specifically for tests.
make test
-
Once local instance is available, you can try populating it with the initial fixtures
make fixtures
-
Now a scheduler could be started in one shell
make results_worker
-
In other shell start a worker for making the checks
make checks_worker
-
And in another shell start a results handling worker
make results_worker
-
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