Game server monitoring with metrics, alerting, and performance tracking for production reliability
Monitors game server health with Prometheus metrics for player counts, tick rates, and latency. Triggers alerts when tick duration exceeds 20ms, player counts drop below 10, or servers go down.
/plugin marketplace add pluginagentmarketplace/custom-plugin-server-side-game-dev/plugin install server-side-game-dev-plugin@pluginagentmarketplace-game-serverThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/metrics-dashboard.yamlreferences/GUIDE.mdreferences/MONITORING_GUIDE.mdscripts/helper.pyscripts/metrics_collector.pyMonitor game server health with metrics, logs, and alerts.
const prometheus = require('prom-client');
// Player metrics
const activePlayers = new prometheus.Gauge({
name: 'game_active_players',
help: 'Currently connected players',
labelNames: ['region', 'game_mode']
});
const matchesInProgress = new prometheus.Gauge({
name: 'game_matches_active',
help: 'Active matches',
labelNames: ['game_mode']
});
// Performance metrics
const tickDuration = new prometheus.Histogram({
name: 'game_tick_duration_seconds',
help: 'Game loop tick duration',
buckets: [0.001, 0.005, 0.01, 0.016, 0.033]
});
const networkLatency = new prometheus.Histogram({
name: 'game_network_latency_ms',
help: 'Player network latency',
labelNames: ['region'],
buckets: [10, 25, 50, 75, 100, 150, 200]
});
groups:
- name: game-alerts
rules:
- alert: GameServerDown
expr: up{job="game-servers"} == 0
for: 1m
labels:
severity: critical
- alert: HighTickLatency
expr: histogram_quantile(0.99, game_tick_duration_seconds) > 0.02
for: 5m
labels:
severity: high
- alert: LowPlayerCount
expr: game_active_players < 10
for: 10m
labels:
severity: warning
| Metric | Target | Alert |
|---|---|---|
| Tick Rate | 60 Hz | < 55 Hz |
| Latency P99 | < 100ms | > 200ms |
| Memory | < 80% | > 90% |
| CPU | < 70% | > 85% |
| Error | Root Cause | Solution |
|---|---|---|
| Missing metrics | Scrape failure | Check targets |
| Alert storms | Too sensitive | Tune thresholds |
| Dashboard slow | Too many queries | Aggregate |
| Gaps in data | Network issues | Add redundancy |
# Check Prometheus targets
curl localhost:9090/api/v1/targets | jq '.data.activeTargets'
# Check firing alerts
curl localhost:9090/api/v1/alerts | jq '.data.alerts'
# Query metrics
curl 'localhost:9090/api/v1/query?query=game_active_players'
describe('Metrics', () => {
test('records tick duration', async () => {
const end = tickDuration.startTimer();
await sleep(10);
end();
const metrics = await prometheus.register.metrics();
expect(metrics).toContain('game_tick_duration_seconds');
});
});
assets/ - Dashboard configsreferences/ - Alerting guidesThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.