Observability blind spots found in the 11-12 live investigation (item ledger, history retention, alerts)

未关闭
#3,307 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
12/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
go, sqlite

调研方向

This is a multi-part design issue, not a single change. Start with the hourly bucket code behind npc_sale and monster_gold, then the economy_ledger writer and the history.sqlite pruner, and read #3302 for the census index. Done when each checklist box is a merged change or a recorded decision not to do it.

由索引模型根据 Issue 内容生成。

描述

area: server enhancement priority: high

The 2026-11-12 live investigation (#3302, #3303 and the starter-refill issue) had to infer facts the server should record. Each line is data we lacked; fix them so the next investigation reads facts instead of joining timestamps.

Items

  • No item ledger. Gold has economy_ledger; items have nothing. A grant (starter kit, refill, quest, GM, mall, drop pickup), a merchant sale, a stall or exchange transfer and a destroy leave no row saying which item, how many, and through which door. A duplication cannot be proved or cleared after the fact without diffing nightly backups.
  • npc_sale and monster_gold fold into hourly buckets holding only total and n. The item sold is lost at once. Keep a per-character, per-item hourly bucket (item ref, count, gold).
  • stall_sale and exchange rows name no counterparty and no item. Finding who paid 1,000,000,000 to whom, and for what, took a self-join on at_ms. Record the counterparty character and the items on both sides.

Sessions

  • history.sqlite kept only about 90 minutes: two accounts wrote most of 200k events (every transport log line of every session becomes an event) and the pruner dropped everyone's older history. Budget events per account, and do not store per-session transport info lines as history events.
  • GameWorld and Agent logs live only in the Nomad alloc and vanish at the next release. Ship them to durable storage with a retention rule (they hold player names, so staff-only).
  • The Agent logs only refused admission tickets. Count minted tickets per account (a counter and a journal column), so a mint rate is visible.
  • The connection journal has no per-session summary of what the session did: frames in, opcodes used, time to first action. "Entered, sold, left in one second" was inferred from three stores.

Detection

  • Nothing alerted. account_session_evictions reached 74k, one account opened 3 sessions a second for a day, and 97% of the connection journal came from four accounts. The monitor needs rate alerts: sessions per account per minute, evictions per minute, entries per character per hour, merchant sales per entry.
  • A websocket session with no User-Agent is not a browser (every browser sends one). It is recorded and never surfaced. Show it in the console and count it.
  • The console has no "top accounts by session churn / by minted gold per hour" view; the hourly buckets already hold the gold half.
  • Every free grant (kit, refill, beta silk, starter silk) needs a counter per account per day, so a mint shows as a number that grows.

Performance of the tools themselves

  • The census index is quadratic in sessions per account (#3302), so the abuse it should expose degrades the server.

Done when each box is a merged change or a recorded decision not to do it.

主要语言
Go
星标
97
派生
61
平均合并
4 小时 14 分钟
30 天内合并 PR
913

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

opensro-dev/opensro 的其他 Issue

查看 opensro-dev/opensro 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。