Service | Purpose |
---|---|
algo-api | The main application that exposes the API |
loadgen | A sample app to simulate load on the API (idea taken from here) |
prometheus | For collectiong metrics |
grafana | For visualization of metrics |
docker-compose build
docker-compose up -d
Once application starts the loadgen
will start randomly query available endpoints which will allow to visialize some data in monitoring.
Documentation is autogenerated and can be found under http://localhost:8000/docs
As mentioned above monitroing is done with Prometheus and it's visilaied via Grafana.
There is already configured Grafana dashboard with some basic metrics, like QPS and HTTP Latency.
The configured dashboard is called "Algorithms API"
(I'm sending the .grafana
folder which stores the Grafana database)
Grafana can be accessed under http://localhost:3000/ username/password - admin/admin
docker-compose run --rm algo-api poetry run pytest ./
- There are some shortcuts in Makefile which I used on my local.
- Multistage build for smaller image
- Extend test for API for other routes
- Find a way to register new function by avoiding too much copy/pasting
- Avoid hardcoding config parameters e.g. pushgateway