feat(registry): opt-in product events, kept 90 days and counted on /metrics #12

Merged
kblack0610 merged 1 commit from feat/registry-events into main 2026-11-03 17:55:55 +00:00
Owner

Games whose player turns on "Share anonymous usage" send batches of events here (plan bright-pebble P5a).

  • POST /api/v1/events: 1 to 100 events under a random install id, 12 batches a minute per install, props a JSON object of at most 1 KiB, a bad device clock replaced by the arrival time.
  • DELETE /api/v1/events/{install}: removes one install's events when sharing is turned off.
  • Migration 0003_events.sql; an hourly sweep drops rows older than 90 days.
  • /metrics: bnb_events_24h{game,kind} and bnb_event_installs_24h{game}.
  • TestMigrateTwiceIsANoOp counts the embedded migrations instead of a hard-coded 2.

Verified: go test ./... and go vet clean in golang:1.23 against Postgres 17 and MinIO (8 new tests).

https://claude.ai/code/session_01AWkPstXJVuifTEY3Zbjk28

Games whose player turns on "Share anonymous usage" send batches of events here (plan bright-pebble P5a). - POST /api/v1/events: 1 to 100 events under a random install id, 12 batches a minute per install, props a JSON object of at most 1 KiB, a bad device clock replaced by the arrival time. - DELETE /api/v1/events/{install}: removes one install's events when sharing is turned off. - Migration 0003_events.sql; an hourly sweep drops rows older than 90 days. - /metrics: bnb_events_24h{game,kind} and bnb_event_installs_24h{game}. - TestMigrateTwiceIsANoOp counts the embedded migrations instead of a hard-coded 2. Verified: go test ./... and go vet clean in golang:1.23 against Postgres 17 and MinIO (8 new tests). https://claude.ai/code/session_01AWkPstXJVuifTEY3Zbjk28
POST /api/v1/events takes a batch of 1 to 100 events under a random install id, rate limited per install; DELETE /api/v1/events/{install} removes one install's events on opt-out. An hourly sweep drops events older than 90 days, and /metrics exports bnb_events_24h{game,kind} and bnb_event_installs_24h{game}.

Claude-Session: https://claude.ai/code/session_01AWkPstXJVuifTEY3Zbjk28
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kblack0610/bnb-game-servers!12
No description provided.