Мониторинг сервера
Сервер REST API предоставляет следующие эндпоинты с метриками, совместимыми с Prometheus:
GET /monitoring/metrics- метрики сервера, такие как количество запросов на каждый путь и статус ответа, использование CPU и RAM(оперативной памяти) и т. д.
Эти эндпоинты включаются и настраиваются с помощью следующих параметров:
Bases: BaseModel
Monitoring Settings.
See starlette-exporter <https://github.com/stephenhillier/starlette_exporter#options>_ documentation.
.. note::
You can pass here any extra option supported by ``starlette-exporter``,
even if it is not mentioned in documentation.
Examples
.. code-block:: yaml :caption: config.yml
server:
monitoring:
enabled: True
labels:
instance: "production"
skip_paths:
- "/some/path"
skip_methods:
- OPTIONS
group_paths: True
filter_unhandled_paths: True
# custom option passed directly to starlette-exporter
Source code in syncmaster/server/settings/server/monitoring.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |