There is no way to tell a live quiz is in trouble until someone complains

Aperta
#245 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@spikedeeev ci sta già lavorando.

Dal 22/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Backend first issue enhancement help wanted

Rexial has no metrics and no health signal beyond a container healthcheck. When something goes wrong during a live quiz, the first indication is a person noticing.

That is not hypothetical. A load test at 750 participants silently dropped a third of the answers — the players saw their choice highlighted and scored zero, and the only way anyone found out was running a SQL query afterwards out of curiosity. Nothing logged it, nothing alerted, and nothing would have.

What to add

Start small. A /metrics endpoint on ws-server exposing a handful of counters is more useful than a dashboard nobody finishes:

  • WebSocket connections currently open, and sessions in progress
  • Answers submitted, and answers actually persisted — the gap between these two is the number that matters
  • Flush failures and transaction errors from the answer queue
  • Question close latency: how long between the timer ending and the results broadcast

The answer queue in apps/ws-server/src/utils/answerQueue.ts already knows most of this; it just does not report it.

Prometheus text format is the obvious choice — it is a plain text endpoint, needs no infrastructure to start with, and can be scraped later if you want graphs.

Worth thinking about
  • Do not put it on the public port. A metrics endpoint that tells anyone how many quizzes are running is an information leak. Either a separate port or an auth check.
  • Cardinality. A counter per session id will grow without bound. Aggregate counters, not per-session labels.
  • http-server and streaming want the same treatment eventually, but one service done properly is better than three done shallowly. Start with ws-server, where the real-time failures are.
Definition of done
  • A metrics endpoint exposing at least submitted-vs-persisted answers and flush failures
  • Not reachable from the public internet without auth
  • Counters are bounded — no per-session labels
  • A short note in ARCHITECTURE.md on what is exposed and how to read it

Good backend issue for someone who wants to work on operability rather than features. The interesting part is choosing which numbers would actually have caught the bug above — that is a design question, not a plumbing one.

Lingua principale
TypeScript
Stelle
21
Fork
7
Merge medio
7h 54m
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TheCodeHeist-Coder/Rexial

Tutte le issue di TheCodeHeist-Coder/Rexial

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.