[PR #252] [MERGED] Opt-in data collection (3/5): the game keeps crash reports and session summaries only with consent #2439

Closed
opened 2026-11-02 15:56:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/252
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: feat/telemetry-game


📝 Commits (1)

  • d7b9751 Opt-in data collection (3/5): the game obeys the player's consent

📊 Changes

9 files changed (+428 additions, -2 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/horizon-client/Cargo.toml (+2 -0)
📝 crates/horizon-client/src/crash.rs (+4 -2)
📝 crates/horizon-client/src/game.rs (+37 -0)
📝 crates/horizon-client/src/game/remote.rs (+2 -0)
📝 crates/horizon-client/src/gfx.rs (+7 -0)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/main.rs (+1 -0)
➕ crates/horizon-client/src/telemetry.rs (+373 -0)

📄 Description

What

Third of five PRs for opt-in data collection. It's stacked on #248 and is independent of #250. The game never sends anything itself. When the player allows a kind, the game keeps items in the outbox, and the launcher sends them at its next start. Without consent, crash-reports/ stays local exactly as before.

Crash reports. crash::deliver also keeps a scrubbed copy (telemetry::crash_item):

  • what it keeps: the error, the stack, the thread, and three details: Horizon version, graphics adapter, render settings
  • what it never keeps: the log lines, the world, the server, or the resource-pack names
  • the world's name and folder and the server address are scrubbed wherever they appear, along with user folders, the user name, IPs, e-mails and UUIDs
  • a huge stack is cut from the bottom to fit the 32 KiB cap

Performance. telemetry::Session records:

  • frame times while playing, but not in menus, pause or loading
  • the integrated server's tick times, in single player

Both go into fixed-size Timings (20 KB each, whatever the session length), plus the time to the title screen and to the world. On leaving a world (close_world / leave_server) or quitting, a session of at least a minute becomes a perf summary under 1 KiB, if the player allows performance statistics.

System. GPU name, driver and backend come from the wgpu adapter; the OS, CPU, threads and RAM (rounded to the GB) from System::detect.

How tested

Unit tests in horizon_client::telemetry:

  • the crash item keeps only the allowed details, and the world, server, pack and chat never appear in its JSON
  • a huge stack is cut to fit
  • crashes stay local without crash consent, even with performance allowed
  • a session is kept only with consent and once it's a minute long, with the right counts, settings and size

End to end on the Mac mini: in a scratch HORIZON_HOME with performance and crash consent, the game ran offscreen in a creative world for 83 s, then horizon-ctl quit. The outbox held one 693-byte perf item (2 783 frames, 1 736 ticks, Metal, Apple M4 Pro, render distance 12). With #250 and #251, horizon-launcher data send delivered it to the local ingest server, which showed it in /v1/aggregate; data delete removed it.

pr_ready (tools/pr_ready.py --base feat/telemetry-consent on ludovics-mac-mini, against feat/telemetry-consent at 43138159b, 2 min 8 s)

Check Result
Scope ✅ 9 files, +428 −2
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (1 s)
tests: workspace ✅ 995 passed (2 min 0 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 300 affected, to run in CI (no vanilla data here): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 288 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Parity: CI's Mac mini runner runs the harnesses. This adds timing hooks and an outbox write, and changes no game behaviour.

Needs Ludovic

Nothing. Nothing leaves the machine until the hosting in #251 is approved and DEFAULT_ENDPOINT is set.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/252 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/telemetry-game` --- ### 📝 Commits (1) - [`d7b9751`](https://github.com/horizon-rust/horizon/commit/d7b975185cf7b7746d52ef24df5766e3d1e13476) Opt-in data collection (3/5): the game obeys the player's consent ### 📊 Changes **9 files changed** (+428 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/horizon-client/Cargo.toml` (+2 -0) 📝 `crates/horizon-client/src/crash.rs` (+4 -2) 📝 `crates/horizon-client/src/game.rs` (+37 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+2 -0) 📝 `crates/horizon-client/src/gfx.rs` (+7 -0) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/main.rs` (+1 -0) ➕ `crates/horizon-client/src/telemetry.rs` (+373 -0) </details> ### 📄 Description ## What Third of five PRs for opt-in data collection. It's stacked on #248 and is independent of #250. **The game never sends anything itself.** When the player allows a kind, the game keeps items in the outbox, and the launcher sends them at its next start. Without consent, `crash-reports/` stays local exactly as before. **Crash reports.** `crash::deliver` also keeps a scrubbed copy (`telemetry::crash_item`): - what it keeps: the error, the stack, the thread, and three details: Horizon version, graphics adapter, render settings - what it never keeps: the log lines, the world, the server, or the resource-pack names - the world's name and folder and the server address are scrubbed wherever they appear, along with user folders, the user name, IPs, e-mails and UUIDs - a huge stack is cut from the bottom to fit the 32 KiB cap **Performance.** `telemetry::Session` records: - frame times while playing, but not in menus, pause or loading - the integrated server's tick times, in single player Both go into fixed-size `Timings` (20 KB each, whatever the session length), plus the time to the title screen and to the world. On leaving a world (`close_world` / `leave_server`) or quitting, a session of at least a minute becomes a perf summary under 1 KiB, if the player allows performance statistics. **System.** GPU name, driver and backend come from the wgpu adapter; the OS, CPU, threads and RAM (rounded to the GB) from `System::detect`. ## How tested Unit tests in `horizon_client::telemetry`: - the crash item keeps only the allowed details, and the world, server, pack and chat never appear in its JSON - a huge stack is cut to fit - crashes stay local without crash consent, even with performance allowed - a session is kept only with consent and once it's a minute long, with the right counts, settings and size End to end on the Mac mini: in a scratch `HORIZON_HOME` with performance and crash consent, the game ran offscreen in a creative world for 83 s, then `horizon-ctl quit`. The outbox held one 693-byte perf item (2 783 frames, 1 736 ticks, Metal, Apple M4 Pro, render distance 12). With #250 and #251, `horizon-launcher data send` delivered it to the local ingest server, which showed it in `/v1/aggregate`; `data delete` removed it. **pr_ready** (`tools/pr_ready.py --base feat/telemetry-consent` on ludovics-mac-mini, against feat/telemetry-consent at 43138159b, 2 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +428 −2 | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 s) | | tests: workspace | ✅ 995 passed (2 min 0 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 300 affected, to run in CI (no vanilla data here): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 288 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Parity: CI's Mac mini runner runs the harnesses. This adds timing hooks and an outbox write, and changes no game behaviour. ## Needs Ludovic Nothing. Nothing leaves the machine until the hosting in #251 is approved and `DEFAULT_ENDPOINT` is set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:56:09 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#2439
No description provided.