Skip to content

v0.18.0

Choose a tag to compare

@sleep3r sleep3r released this 15 Apr 15:17
4574c2c

🇷🇺 Что нового (RU)

Что решает этот релиз

  • Встроенный Prometheus-эндпоинт — мониторинг прокси без парсинга логов и внешних экспортёров.
  • Установка дашборда больше не ломается на Debian 12+ / Ubuntu 23.04+ из-за PEP 668 (externally-managed-environment).

Что изменено

  • Prometheus /metrics endpoint (#179)

    • Новая секция [metrics] в config.toml (enabled, host, port).
    • Прокси поднимает отдельный HTTP-listener и отдаёт метрики в Prometheus text format.
    • Глобальные метрики: активные подключения, handshakes in flight, accepted/closed totals, drop-счётчики, трафик (C2S/S2C bytes).
    • Per-user метрики: mtproto_user_connections_active, mtproto_user_*_bytes_total — по настроенным пользователям.
    • Метрики процесса: RSS, VSZ, CPU, open FDs.
    • cgroup-метрики (опциональные): mtproto_cgroup_memory_usage_bytes, mtproto_cgroup_memory_limit_bytes — для Docker/контейнеров.
    • Готовый Grafana-дашборд (hack/docker/grafana-dashboard.json) + Docker Compose стек (Prometheus + Grafana).
    • Документация в hack/docker/README.md.
  • Dashboard: pip3 → uv (#185, #189)

    • pip3 install заменён на uv — быстрый менеджер Python-пакетов.
    • Зависимости ставятся в изолированный virtualenv (/opt/mtproto-proxy/monitor/.venv), а не в системный Python.
    • Если uv не установлен — скачивается автоматически через официальный astral.sh/uv/install.sh.
    • Systemd-сервис proxy-monitor теперь запускает server.py через .venv/bin/python.
    • Убрана зависимость от python3-pip.

Important

Для обновления дашборда на существующих серверах:

sudo mtbuddy update          # обновить бинарь
sudo mtbuddy setup dashboard # переустановить дашборд (создаст venv через uv)

🇬🇧 Release notes (EN)

What this release addresses

  • Built-in Prometheus metrics — monitor the proxy without log parsing or external exporters.
  • Dashboard installation no longer breaks on Debian 12+ / Ubuntu 23.04+ due to PEP 668 (externally-managed-environment).

What changed

  • Prometheus /metrics endpoint (#179)

    • New [metrics] config section (enabled, host, port).
    • The proxy starts a dedicated HTTP listener serving metrics in Prometheus text format.
    • Global metrics: active connections, handshakes in flight, accepted/closed totals, drop counters, C2S/S2C traffic bytes.
    • Per-user metrics: mtproto_user_connections_active, mtproto_user_*_bytes_total — keyed by configured users.
    • Process metrics: RSS, VSZ, CPU seconds, open/max FDs.
    • Optional cgroup metrics: mtproto_cgroup_memory_usage_bytes, mtproto_cgroup_memory_limit_bytes — appear automatically in containers.
    • Ready-to-import Grafana dashboard (hack/docker/grafana-dashboard.json) + Docker Compose stack (Prometheus + Grafana).
    • Docs at hack/docker/README.md.
  • Dashboard: pip3 → uv (#185, #189)

    • Replaced pip3 install with uv for Python dependency management.
    • Dependencies are installed into an isolated virtualenv (/opt/mtproto-proxy/monitor/.venv) instead of the system Python.
    • If uv is not present, it is bootstrapped automatically via the official astral.sh/uv/install.sh installer.
    • The proxy-monitor systemd service now runs server.py via .venv/bin/python.
    • Removed python3-pip prerequisite.

Important

To update the dashboard on existing servers:

sudo mtbuddy update          # update the binary
sudo mtbuddy setup dashboard # redeploy dashboard (creates venv via uv)

Changelog

  • feat: Metrics endpoint (#179) (6cc6674)
  • feat(dashboard): replace pip3 with uv for dependency management (#189, closes #185) (83614bc)