client_logs: background device diagnostics collection #8

Merged
richiexec merged 1 commit from feature/client-logs-telemetry into main 2026-07-23 11:19:42 +00:00
Owner

Backend half of feedback 2 §4 — a place for prod devices to report diagnostics I can query without attaching a debugger.

  • client_logs collection (1788000000_client_logs.js): user (relation), kind, event, message, meta (json), appVersion, platform, device, ts, created. Rules: owner-create-only, everything else null (superuser-read-only) — devices can append their own rows and nobody but an admin can read them.
  • Retention (client_logs.pb.js): nightly cron trims rows older than 14 days (diagnostics, not an archive).
  • Contract (docs/telemetry-contract.md): the event catalogue (uncaught, exo_error, av_delay_applied, session_summary), the exact curl to query it as superuser, and the privacy guarantees — the client redacts stream URLs to scheme://host and never sends an addon token or full signed URL.

The app side (TelemetryService, ring buffer, redaction, kill switch, the player signals) is amber-app PR #82. Once this deploys, av_delay_applied + session_summary.stalls give real fleet data on the "a track falls behind" reports.

🤖 Generated with Claude Code

Backend half of feedback 2 §4 — a place for prod devices to report diagnostics I can query without attaching a debugger. - **`client_logs`** collection (`1788000000_client_logs.js`): `user` (relation), `kind`, `event`, `message`, `meta` (json), `appVersion`, `platform`, `device`, `ts`, `created`. Rules: **owner-create-only**, everything else **null (superuser-read-only)** — devices can append their own rows and nobody but an admin can read them. - **Retention** (`client_logs.pb.js`): nightly cron trims rows older than 14 days (diagnostics, not an archive). - **Contract** (`docs/telemetry-contract.md`): the event catalogue (`uncaught`, `exo_error`, `av_delay_applied`, `session_summary`), the exact curl to query it as superuser, and the privacy guarantees — the client redacts stream URLs to `scheme://host` and never sends an addon token or full signed URL. The app side (TelemetryService, ring buffer, redaction, kill switch, the player signals) is amber-app PR #82. Once this deploys, `av_delay_applied` + `session_summary.stalls` give real fleet data on the "a track falls behind" reports. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
richiexec added 1 commit 2026-07-23 09:49:25 +00:00
The family runs Amber on hardware I can't debug directly, so the app batches
a low-volume diagnostic stream here: uncaught errors, player error codes,
per-session playback summaries, and the audio-delay a user dials in to fix
desync (the "a track falls behind" signal).

- Migration 1788000000_client_logs.js: owner-create-only, superuser-read-only
  (list/view/update/delete = null); fields kind/event/message/meta/appVersion/
  platform/device/ts + created.
- client_logs.pb.js: nightly cron trims rows older than 14 days.
- docs/telemetry-contract.md: event catalogue, how I query it, and the
  privacy/redaction guarantees (host-only, never a token or full URL).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
richiexec merged commit 2c1c4dde0b into main 2026-07-23 11:19:42 +00:00
richiexec deleted branch feature/client-logs-telemetry 2026-07-23 11:19:42 +00:00
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: richiexec/amber-backend#8
No description provided.