monitoring-game-ops
Structured logs, server health signals and alert rules for a live multiplayer game server: tick time against the tick budget, room and WebSocket connection…
от fcsouza★ 29 звёзд на GitHub
Установить monitoring-game-ops в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Monitoring Game Ops
A game server needs two outputs. Log lines answer "what happened to this
player in this room". Metrics answer "is the server healthy right now".
Player behaviour (DAU, session length, D1/D7/D30 retention, funnels) is
analytics, not ops: use gameplay-analytics for it.
Logging
- One JSON object per line, written to stdout/stderr. Fields:
level,message,timestamp,context(service,component,playerId,sessionId,roomId,requestId),data,error. - Per-request values (request id, start time) come from
.derive(), never fromstore. Elysia'sstoreis one global object for the whole app, so concurrent requests overwrite each other's values.deriveruns once per request, and its values are not shared with other requests. - Register
requestLoggerbefore the routes it should log. Elysia hooks apply only to routes registered after them. - A request with no matching route, or a body that does not parse, fails
before
deriveruns. Those lines carry norequestId. The plugin logs them, and validation failures, aswarnrequest_rejected, so the error rate counts server faults only. - A validation failure logs the target (
body,query...), the property path and the schema rule it broke, never the rejected value. Elysia'serror.messageand its summary both include the input, and a login body holds a password. - Create one session logger per WebSocket connection and pass it to the room. Every line from that player's messages then carries the player, session and room.
- Do not log per entity per tick. Line volume multiplies by the tick rate and the room count. Count per-tick work in metrics; log state changes (player joined, match ended, tick overrun).
Health signals
templates/alert-config.ts defines these names. Record durations as
histograms, never as averages: a mean hides the slow tail, and the tail is
what players feel as lag.
| Signal | Instrument | Where the threshold comes from |
|---|---|---|
game.tick.duration (p99) |
histogram, seconds | Tick budget: 1 / tickRate times a headroom fraction. Tick rate from game-backend-architecture. |
game.tick.overruns |
counter | Ticks that took longer than the interval. A sustained count means rooms fall behind. |
game.rooms.active, game.ws.connections |
up-down counter | A load test of one server (see below). |
game.ws.closes by code |
counter | Baseline per close code. |
game.messages.errors by mode, messageType |
counter | Baseline rate. |
game.matchmaking.wait (p95) |
histogram, seconds | Baseline per mode. The queue design is in matchmaking-system. |
game.jobs.failed by queue |
counter | Baseline. Count failed and stalled jobs from the queue events in bullmq-game-queues. |
game.currency.minted, game.currency.spent |
counter | The sink and faucet targets in game-economy-design. |
- Error rate per room: put
roomIdin the log context and query the logs. Do not makeroomId,playerIdorsessionIda metric label: each value becomes its own time series. - WebSocket close code 1006 means the connection closed abnormally, without
a Close frame; Bun's
closehandler reports 1006 when the client process dies. 1000 is a normal close; 1001 is a page navigating away or a server going down. Alert on a rise in 1006, not on total closes.
Setting thresholds
- Tick: compute the interval from the tick rate. Profile a full room and
pick the headroom fraction from that profile. A tick that uses the whole
interval falls behind under the first spike, so the alert must fire below
the interval.
tickOverrunRuletakes both values. - Capacity: load-test one server with bots until tick p99 crosses the
budget. That room and connection count is the measured limit.
capacityRulefires at a fraction of it that you choose. - Everything else: measure a baseline over normal play, including a peak
hour and a quiet hour, then set a factor with
baselineRule. Tighten or loosen it after the first false alert. - Route: page only for a problem players feel now that a person can act on.
Everything else is a ticket. Every rule has a
runbookline saying what the responder does first.
Post-deploy check
- Tick p99 and overruns per mode match the previous release at the first peak after deploy.
- 1006 closes did not rise.
- No new
messageTypeappears ingame.messages.errors. - No rise in failed or stalled jobs.
- Currency minted against spent stays inside the
game-economy-designtargets.
ci-cd-game runs the deploy; this list is what to look at afterwards.
Pitfalls
- Request id or start time in
store: wrong ids and durations under load. - Average tick time: looks fine while a few rooms stutter. Use p99 and the overrun counter.
- 404s and bad payloads logged as errors: the error rate rises with every sc
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- boilerplate/logger.ts
- references/sources.md
- templates/alert-config.ts
FAQ
Что делает скилл monitoring-game-ops?
Structured logs, server health signals and alert rules for a live multiplayer game server: tick time against the tick budget, room and WebSocket connection counts, disconnects, errors per game mode and message type, failed jobs and currency flow. Use when a game server needs logging, a health dashboard or alerts, when players report lag or drops and you need to see why, or when a release needs post-deploy checks; the code targets Bun and Elysia.
Как установить скилл monitoring-game-ops?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл monitoring-game-ops запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…