Skip to content

feat(telemetry): add UI toggle and YAML-driven hot-reload for telemetry#150

Open
Gucc111 wants to merge 3 commits into
mainfrom
feat/telemetry-ui-toggle
Open

feat(telemetry): add UI toggle and YAML-driven hot-reload for telemetry#150
Gucc111 wants to merge 3 commits into
mainfrom
feat/telemetry-ui-toggle

Conversation

@Gucc111
Copy link
Copy Markdown
Collaborator

@Gucc111 Gucc111 commented Jun 3, 2026

Summary

  • Add a Telemetry toggle in Settings > Advanced section, allowing users to enable/disable telemetry from the Web UI without restarting the process.
  • Introduce telemetry.enabled as a first-class field in pilotdeck.yaml, parsed by the gateway config store.
  • Wire up a hot-reload path: configStore.subscribe detects telemetry.* changes and calls telemetry.setEnabled() at runtime, starting/stopping the flush timer accordingly.
  • Remove the ANALYTICS_ENABLED environment variable intermediate layer — telemetry is now driven directly by YAML config.
  • Fix a rawRef race condition in usePilotDeckConfig where save() could read stale YAML when called immediately after setRaw().

Changes (11 files, +109/−8)

Layer Files What
Telemetry module types.ts, collector.ts, sender.ts Add setEnabled() API with timer start/stop
Gateway config config/types.ts, loadPilotConfig.ts Parse telemetry section, add PilotTelemetryConfig
Gateway entry pilotdeck.ts Pass initial value, subscribe for hot-reload
UI server pilotdeckConfig.js Add default, remove env var mapping
UI frontend Settings.tsx, usePilotDeckConfig.ts Toggle row + rawRef race fix
i18n en/settings.json, zh-CN/settings.json Translations

Test plan

  • Start PilotDeck, open Settings > Advanced, verify Telemetry toggle appears (default OFF)
  • Toggle ON, verify shutdown log shows non-zero queued/sent counts after some activity
  • Toggle OFF while running, verify flush completes and no further events are queued
  • Edit pilotdeck.yaml externally to set telemetry.enabled: true, verify gateway picks up the change without restart
  • Verify gateway produces no CONFIG_UNKNOWN_FIELD warning for the telemetry key

Made with Cursor

Gucc111 and others added 3 commits June 3, 2026 17:00
…ings UI

Wire a top-level `telemetry: { enabled: false }` field in
pilotdeck.yaml so the analytics opt-in can be controlled from the
Web UI Settings > Advanced section instead of raw env vars.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ale YAML

updateRaw now writes rawRef.current synchronously so that callers
who invoke setRaw + save in the same event loop (e.g. the telemetry
toggle) no longer race against React's batched re-render.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the env-var-based ANALYTICS_ENABLED mapping with a direct
YAML config path: gateway now parses telemetry.enabled from the
config snapshot and subscribes to config changes via configStore.

- Add setEnabled() to TelemetryClient/TelemetrySender for runtime
  enable/disable (starts/stops the flush timer accordingly)
- Parse telemetry section in loadPilotConfig and add to PilotConfig
- Pass initial enabled value from config snapshot in pilotdeck.ts
- Subscribe to telemetry.* changes for hot-reload
- Remove ANALYTICS_ENABLED env var mapping from buildRuntimeEnv

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant