Adds tavolo.active_users and tavolo.ongoing_games gauges, process/CPython metrics via opentelemetry-instrumentation-system-metrics and OTLP log export. The game store tracks ongoing matches (Redis sorted set, in-memory set) and the session stores expose live counts for the gauges; a poller refreshes them since metric callbacks cannot await the stores.
1.4 KiB
1.4 KiB
tavolo-app
The deployable tavolo application: the composition root wiring
tavolo-platform to the
tavolo-scopone game.
Contents
app.py— assembles theKayaApp(session/OIDC/Tortoise/OpenAPI mixins plusPlatformMixinand the deadline scheduler), registers theScoponeEnginewith its configured timeouts, and exposestavolo.app:appfor granian.config.py— environment-driven frozenSettings.telemetry.py— the optional OpenTelemetry wiring beyond kaya-otel: meter/logger providers, thetavolo.active_users/tavolo.ongoing_gamesgauges (polled from the stores), process/CPython metrics viaopentelemetry-instrumentation-system-metricsand OTLP log export.aerich_config.py— Tortoise ORM configuration consumed by the aerich CLI (migrations live inserver/migrations/; aerich itself is configured via the[tool.aerich]section ofserver/pyproject.toml).logging_config.py— logging setup.static.py— SPA shell hosting for the compiled frontend.
Development (from packages/tavolo-app/)
.venv/bin/python -m mypy --namespace-packages --explicit-package-bases \
src/tavolo/app.py \
src/tavolo/config.py \
src/tavolo/telemetry.py \
src/tavolo/static.py \
src/tavolo/aerich_config.py \
src/tavolo/logging_config.py
End-to-end coverage of the wired stack lives in server/tests/.