[PR #1276] [MERGED] Telemetry: telemetry.playhorizon.dev by default, a benchmarks summary, the Railway config #3477

Closed
opened 2026-11-03 04:09:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/telemetry-live


📝 Commits (1)

  • be16401 Telemetry: send to telemetry.playhorizon.dev, a benchmarks summary, the Railway config

📊 Changes

26 files changed (+747 additions, -63 deletions)

View changed files

📝 .github/workflows/ci.yml (+4 -0)
📝 .github/workflows/launcher.yml (+4 -0)
📝 .github/workflows/nightly.yml (+4 -0)
📝 .github/workflows/parity.yml (+4 -0)
📝 .github/workflows/run-parity.yml (+4 -0)
📝 crates/horizon-client/src/heartbeat.rs (+2 -2)
📝 crates/horizon-telemetry-server/README.md (+34 -3)
➕ crates/horizon-telemetry-server/railway.json (+21 -0)
📝 crates/horizon-telemetry-server/src/lib.rs (+86 -12)
📝 crates/horizon-telemetry-server/src/store.rs (+20 -14)
➕ crates/horizon-telemetry-server/src/summary.rs (+266 -0)
📝 crates/horizon-telemetry-server/tests/server.rs (+23 -7)
➕ crates/horizon-telemetry-server/tests/summary.rs (+180 -0)
📝 crates/horizon-telemetry/src/lib.rs (+29 -7)
📝 docs/telemetry.md (+5 -3)
📝 launcher/src/cli.rs (+1 -1)
📝 launcher/src/collection.rs (+1 -1)
📝 launcher/src/telemetry.rs (+5 -3)
📝 tools/agent_control_e2e.py (+2 -1)
📝 tools/graphics_bench.py (+2 -0)

...and 6 more files

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Phase 2 of web-releases-bench-1 (brief telemetry-host-1). It turns on the telemetry server for players and gives the website's Benchmarks page (#1274) its live data. It is a separate PR from the site and has no label, because it changes the game and the launcher.

What

  • Endpoint. DEFAULT_ENDPOINT = https://telemetry.playhorizon.dev. The name was free: it has no DNS record yet and nothing uses it.
    • The game's heartbeat, the launcher's "N playing now" and the outbox upload all go through horizon_telemetry::endpoint(), so they all use it.
    • HORIZON_TELEMETRY_URL still points them at another server.
    • New: HORIZON_TELEMETRY_URL=off sends nothing at all. CI (ci, parity, run-parity, nightly, launcher workflows) and the harnesses that start the game or launcher (perf_bench, graphics_bench, agent_control_e2e, launcher_mcp_e2e) set it, so test runs never ping production or count as players.
    • Unit tests were already offline: they pass the mock server's URL directly.
  • Consent is unchanged. The four switches stay opt-in; only the anonymous "I'm playing" ping is always on, as decided and disclosed. The launcher's wording for a missing server became wording for "turned off".
  • GET /v1/benchmarks/summary (src/summary.rs), in the shape agreed for the page:
    • It applies the same rules as website/scripts/benchmarks.mjs and is tested on the same fixtures (website/scripts/fixtures/benchmarks/, identical files in both PRs).
    • Only comparable reports count: version 1, the standard flight over the 4 scenes, VSync off, no cap, on screen, Horizon or plain vanilla, with a GPU and a CPU.
    • Groups are GPU + CPU + RD + game, published only with ≥ 3 installs. Medians are taken per install first, then across installs.
    • Never in the output: an install ID, a day, an OS version, a driver, a memory size or a screen.
    • Cached 10 minutes, with CORS for playhorizon.dev. A deleted install leaves its groups at once.
  • Privacy fix. /v1/aggregate used to list the newest 50 raw benchmark reports: one install each, with hardware, driver and day, and no minimum group size. Nothing read that list, so it is gone. Uploads are now published only through the summary.
  • Behind Railway's proxy. The rate limit counts X-Real-IP, falling back to the last X-Forwarded-For entry. Before, it used the first entry, which a client can set itself. The address is still kept in memory only and never stored or logged. Tests check the spoof case. I checked: no table has an address column, and the e2e database dump holds no IP.
  • Railway config. crates/horizon-telemetry-server/railway.json:
    • Dockerfile build from the repository root, so the service's root directory is / and its config path is /crates/horizon-telemetry-server/railway.json.
    • Health check /healthz, restart on failure, one replica in europe-west4 (one SQLite file on the volume).
    • The Dockerfile already sets HORIZON_TELEMETRY_DB=/data/telemetry.sqlite3 and trusts the proxy; the volume goes at /data.
  • Docs. docs/telemetry.md, the server README (the summary's shape and the Railway setup) and the privacy page: the ping is on, where the data lives (Railway, EU, Amsterdam, 180 days), and how benchmark uploads are shown.

Summary JSON shape

{ "format": "horizon-benchmark-summary", "version": 1, "generated": "2026-10-22T19:48:13Z", "min_installs": 3,
  "groups": [ { "gpu": "Apple M4 Pro", "cpu": "Apple M4 Pro", "render_distance": 12, "game": "horizon",
                "source": "players", "installs": 3, "reports": 3, "versions": ["v2026.10.22.04"],
                "medians": { "avg_fps": 144, "low_1pct_fps": 97, "p95_ms": 7.7, "world_ms": 11075,
                             "chunk_load_ms": 9438, "rss_peak_mb": 1332, "rss_steady_mb": 1201 } } ] }

How tested

server workspace: cargo fmt --check ✓ · cargo clippy --all-targets -- -D warnings ✓ · cargo test ✓ (unit 3, live 5, server 8, summary 4)
main workspace:   cargo fmt --all --check ✓ · cargo clippy --workspace --all-targets -- -D warnings ✓ · cargo test -p horizon-telemetry ✓ (30 + 7)
launcher (Linux, ThinkPad, in launcher/shell.nix): cargo fmt --check ✓ · cargo clippy --all-targets -- -D warnings ✓ · cargo test ✓ (97 + 14 + 1 + 1)

Local end-to-end on the Mac mini (~/code/horizon-parity/shots/web-releases-bench-1/scripts/e2e-mac.sh, log in e2e/):

  1. Ran this branch's server on 127.0.0.1.
  2. Started the release game with HORIZON_TELEMETRY_URL pointing at it. GET /v1/live went from playing 0 to {"playing":1,"versions":{"v2026.10.22.04":1},"platforms":{"macos":1}} within 15 s.
  3. Three installs posted the Mac mini's real benchmark report through POST /v1/batch (204 each). GET /v1/benchmarks/summary returned the group above, with Access-Control-Allow-Origin: https://playhorizon.dev. Its medians are identical to what benchmarks.mjs bakes from the same report.
  4. After DELETE /v1/installs/<3rd>, the group was gone.
  5. /v1/aggregate has no raw benchmarks, and the database holds no IP address.

Launcher end to end on the ThinkPad (headless GPU sway, scripts/e2e-tp.sh). This branch's server and launcher with HORIZON_TELEMETRY_URL set to the local server:

  • The release game pinged it: {"playing":1,…,"platforms":{"linux":1}} after 15 s.
  • The launcher's Play page then showed "1 playing now" (screenshot e2e/launcher-playing-now-thinkpad.png).
  • The first-run question still has every switch off with the ping marked "Always on" (e2e/launcher-first-run-consent-thinkpad.png).
  • data status printed Server: http://127.0.0.1:18431.

Deploy: not done, waiting on Railway access

The Agents vault has no Railway token, and the claude.ai Railway connector needs Ludovic to authorise it again. Once either exists:

  1. Create the service in the website's Railway project from this repo (root /, config /crates/horizon-telemetry-server/railway.json).
  2. Add a volume at /data.
  3. Add the custom domain telemetry.playhorizon.dev.
  4. Add the CNAME at Porkbun ("Porkbun API horizon-agents" is in the vault).
  5. Check: curl /healthz, a test batch, GET /v1/live, then delete the test install.

Until then, the game and launcher fail quietly against the name that doesn't resolve: no ping, no count, and items wait in the outbox within its caps. Don't merge this before the server answers, or merge it knowing that.

Needs Ludovic

  • Railway access: re-authorise the claude.ai Railway connector, or put a Railway API token in the Agents vault.

🤖 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/1276 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/telemetry-live` --- ### 📝 Commits (1) - [`be16401`](https://github.com/horizon-rust/horizon/commit/be16401f9034ce3ae3bcd257aacd0b6730ea5d4d) Telemetry: send to telemetry.playhorizon.dev, a benchmarks summary, the Railway config ### 📊 Changes **26 files changed** (+747 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+4 -0) 📝 `.github/workflows/launcher.yml` (+4 -0) 📝 `.github/workflows/nightly.yml` (+4 -0) 📝 `.github/workflows/parity.yml` (+4 -0) 📝 `.github/workflows/run-parity.yml` (+4 -0) 📝 `crates/horizon-client/src/heartbeat.rs` (+2 -2) 📝 `crates/horizon-telemetry-server/README.md` (+34 -3) ➕ `crates/horizon-telemetry-server/railway.json` (+21 -0) 📝 `crates/horizon-telemetry-server/src/lib.rs` (+86 -12) 📝 `crates/horizon-telemetry-server/src/store.rs` (+20 -14) ➕ `crates/horizon-telemetry-server/src/summary.rs` (+266 -0) 📝 `crates/horizon-telemetry-server/tests/server.rs` (+23 -7) ➕ `crates/horizon-telemetry-server/tests/summary.rs` (+180 -0) 📝 `crates/horizon-telemetry/src/lib.rs` (+29 -7) 📝 `docs/telemetry.md` (+5 -3) 📝 `launcher/src/cli.rs` (+1 -1) 📝 `launcher/src/collection.rs` (+1 -1) 📝 `launcher/src/telemetry.rs` (+5 -3) 📝 `tools/agent_control_e2e.py` (+2 -1) 📝 `tools/graphics_bench.py` (+2 -0) _...and 6 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Phase 2 of web-releases-bench-1 (brief telemetry-host-1). It turns on the telemetry server for players and gives the website's Benchmarks page (#1274) its live data. It is a separate PR from the site and has no label, because it changes the game and the launcher. ## What - **Endpoint.** `DEFAULT_ENDPOINT` = `https://telemetry.playhorizon.dev`. The name was free: it has no DNS record yet and nothing uses it. - The game's heartbeat, the launcher's "N playing now" and the outbox upload all go through `horizon_telemetry::endpoint()`, so they all use it. - `HORIZON_TELEMETRY_URL` still points them at another server. - New: `HORIZON_TELEMETRY_URL=off` sends nothing at all. CI (`ci`, `parity`, `run-parity`, `nightly`, `launcher` workflows) and the harnesses that start the game or launcher (`perf_bench`, `graphics_bench`, `agent_control_e2e`, `launcher_mcp_e2e`) set it, so test runs never ping production or count as players. - Unit tests were already offline: they pass the mock server's URL directly. - **Consent is unchanged.** The four switches stay opt-in; only the anonymous "I'm playing" ping is always on, as decided and disclosed. The launcher's wording for a missing server became wording for "turned off". - **`GET /v1/benchmarks/summary`** (`src/summary.rs`), in the shape agreed for the page: - It applies the same rules as `website/scripts/benchmarks.mjs` and is tested on the same fixtures (`website/scripts/fixtures/benchmarks/`, identical files in both PRs). - Only comparable reports count: version 1, the standard flight over the 4 scenes, VSync off, no cap, on screen, Horizon or plain vanilla, with a GPU and a CPU. - Groups are GPU + CPU + RD + game, published only with **≥ 3 installs**. Medians are taken per install first, then across installs. - Never in the output: an install ID, a day, an OS version, a driver, a memory size or a screen. - Cached 10 minutes, with CORS for playhorizon.dev. A deleted install leaves its groups at once. - **Privacy fix.** `/v1/aggregate` used to list the newest 50 raw benchmark reports: one install each, with hardware, driver and day, and no minimum group size. Nothing read that list, so it is gone. Uploads are now published only through the summary. - **Behind Railway's proxy.** The rate limit counts `X-Real-IP`, falling back to the **last** `X-Forwarded-For` entry. Before, it used the first entry, which a client can set itself. The address is still kept in memory only and never stored or logged. Tests check the spoof case. I checked: no table has an address column, and the e2e database dump holds no IP. - **Railway config.** `crates/horizon-telemetry-server/railway.json`: - Dockerfile build from the repository root, so the service's root directory is `/` and its config path is `/crates/horizon-telemetry-server/railway.json`. - Health check `/healthz`, restart on failure, one replica in `europe-west4` (one SQLite file on the volume). - The Dockerfile already sets `HORIZON_TELEMETRY_DB=/data/telemetry.sqlite3` and trusts the proxy; the volume goes at `/data`. - **Docs.** `docs/telemetry.md`, the server README (the summary's shape and the Railway setup) and the privacy page: the ping is on, where the data lives (Railway, EU, Amsterdam, 180 days), and how benchmark uploads are shown. ## Summary JSON shape ```json { "format": "horizon-benchmark-summary", "version": 1, "generated": "2026-10-22T19:48:13Z", "min_installs": 3, "groups": [ { "gpu": "Apple M4 Pro", "cpu": "Apple M4 Pro", "render_distance": 12, "game": "horizon", "source": "players", "installs": 3, "reports": 3, "versions": ["v2026.10.22.04"], "medians": { "avg_fps": 144, "low_1pct_fps": 97, "p95_ms": 7.7, "world_ms": 11075, "chunk_load_ms": 9438, "rss_peak_mb": 1332, "rss_steady_mb": 1201 } } ] } ``` ## How tested ``` server workspace: cargo fmt --check ✓ · cargo clippy --all-targets -- -D warnings ✓ · cargo test ✓ (unit 3, live 5, server 8, summary 4) main workspace: cargo fmt --all --check ✓ · cargo clippy --workspace --all-targets -- -D warnings ✓ · cargo test -p horizon-telemetry ✓ (30 + 7) launcher (Linux, ThinkPad, in launcher/shell.nix): cargo fmt --check ✓ · cargo clippy --all-targets -- -D warnings ✓ · cargo test ✓ (97 + 14 + 1 + 1) ``` Local end-to-end on the Mac mini (`~/code/horizon-parity/shots/web-releases-bench-1/scripts/e2e-mac.sh`, log in `e2e/`): 1. Ran this branch's server on 127.0.0.1. 2. Started the release game with `HORIZON_TELEMETRY_URL` pointing at it. `GET /v1/live` went from `playing 0` to `{"playing":1,"versions":{"v2026.10.22.04":1},"platforms":{"macos":1}}` within 15 s. 3. Three installs posted the Mac mini's real benchmark report through `POST /v1/batch` (204 each). `GET /v1/benchmarks/summary` returned the group above, with `Access-Control-Allow-Origin: https://playhorizon.dev`. Its medians are identical to what `benchmarks.mjs` bakes from the same report. 4. After `DELETE /v1/installs/<3rd>`, the group was gone. 5. `/v1/aggregate` has no raw benchmarks, and the database holds no IP address. Launcher end to end on the ThinkPad (headless GPU sway, `scripts/e2e-tp.sh`). This branch's server and launcher with `HORIZON_TELEMETRY_URL` set to the local server: - The release game pinged it: `{"playing":1,…,"platforms":{"linux":1}}` after 15 s. - The launcher's Play page then showed **"1 playing now"** (screenshot `e2e/launcher-playing-now-thinkpad.png`). - The first-run question still has every switch off with the ping marked "Always on" (`e2e/launcher-first-run-consent-thinkpad.png`). - `data status` printed `Server: http://127.0.0.1:18431`. ## Deploy: not done, waiting on Railway access The Agents vault has no Railway token, and the claude.ai Railway connector needs Ludovic to authorise it again. Once either exists: 1. Create the service in the website's Railway project from this repo (root `/`, config `/crates/horizon-telemetry-server/railway.json`). 2. Add a volume at `/data`. 3. Add the custom domain `telemetry.playhorizon.dev`. 4. Add the CNAME at Porkbun ("Porkbun API horizon-agents" is in the vault). 5. Check: `curl /healthz`, a test batch, `GET /v1/live`, then delete the test install. Until then, the game and launcher fail quietly against the name that doesn't resolve: no ping, no count, and items wait in the outbox within its caps. **Don't merge this before the server answers**, or merge it knowing that. ## Needs Ludovic - Railway access: re-authorise the claude.ai Railway connector, or put a Railway API token in the Agents vault. 🤖 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-03 04:09:48 +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#3477
No description provided.