Quarry: Create api health endpoint for monitoring
Python skills are needed to work on Flask and SQLAlchemy frameworks.
Quarry is a simple web interface that can be used to execute queries on sql servers that contain Wikipedia data.
We want to develop the monitoring of this service, to be sure it works as excepted and to be notified if it doesn't. To get this the distant software that will perform the monitoring will in fact fetch on a regular basis a specific url, like /.health/summary/v1/<int:minutes>
, where <int:minutes>
is the period he want to get statistics for. This endpoint will return:
- number of new queries created
- number of new revisions created (that's an SQL code that represents a query revision)
- number of last query runs, grouped by state (successful, failed, ..)
So this task is to create this new api endpoint, that returns computed values, probably generated using SQLAlchemy functions. It will be located in a new health.py
file, loaded using Blueprint (see user.py for existing sample of endpoint present somewhere other than in app.py main file).
Patch in gerrit in analytics/quarry/web repo wanted. Don't hesitate to ask for help or review.