mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(PHP): add aurweb Prometheus metrics
Along with this initial requests metric implementation, we also now serve the `/metrics` route, which grabs request metrics out of cache and renders them properly for Prometheus. **NOTE** Metrics are only enabled when the aurweb system admin has enabled caching by configuring `options.cache` correctly in `$AUR_CONFIG`. Otherwise, an error is logged about no cache being configured. New dependencies have been added which require the use of `composer`. See `INSTALL` for the dependency section in regards to composer dependencies and how to install them properly for aurweb. Metrics are in the following forms: aurweb_http_requests_count(method="GET",route="/some_route") aurweb_api_requests_count(method="GET",route="/rpc",type="search") This should allow us to search through the requests for specific routes and queries. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4e5b67f0a6
commit
986fa9ee30
5 changed files with 183 additions and 2 deletions
8
INSTALL
8
INSTALL
|
@ -49,9 +49,15 @@ read the instructions below.
|
|||
|
||||
# pacman -S python-mysql-connector python-pygit2 python-srcinfo python-sqlalchemy \
|
||||
python-bleach python-markdown python-alembic python-jinja \
|
||||
python-itsdangerous python-authlib python-httpx hypercorn
|
||||
python-itsdangerous python-authlib python-httpx hypercorn \
|
||||
composer
|
||||
# python3 setup.py install
|
||||
|
||||
4a) Install `composer` dependencies while inside of aurweb's root:
|
||||
|
||||
$ cd /path/to/aurweb
|
||||
/path/to/aurweb $ composer require promphp/prometheus_client_php
|
||||
|
||||
5) Create a new MySQL database and a user and import the aurweb SQL schema:
|
||||
|
||||
$ python -m aurweb.initdb
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue