Skip to content

Add telemetry information into the package#226

Merged
guillaume-byte merged 14 commits into
v1.2.3---UI-Optimization-and-new-featuresfrom
telem_info
Jun 25, 2026
Merged

Add telemetry information into the package#226
guillaume-byte merged 14 commits into
v1.2.3---UI-Optimization-and-new-featuresfrom
telem_info

Conversation

@guillaume-byte

Copy link
Copy Markdown
Member

Add telemetry information:

  • Event
  • OS name
  • Package version

guillaume-byte and others added 14 commits June 23, 2026 17:29
Fires a non-blocking async ping to telemetry.graybx.com/v1/ping:
- On first daily import (once per 24h, gated to main process)
- On every `weightslab ui launch`

Payload: random UUID, event name, package version, Python version,
OS, CI flag, client timezone. No PII collected. Raw IP is used
server-side for geolocation (country/city) and never stored.

Opt-out: WL_NO_TELEMETRY=1. CI environments are auto-detected and
skipped via well-known env vars (GITHUB_ACTIONS, CI, GITLAB_CI, etc.).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Add in-process guard (_import_pinged_this_process) so multiple
`import weightslab` calls within the same Python process only
fire one ping, regardless of module reloads or test reruns.
The 24h disk-based cooldown still applies on top.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Remove daemon=True so short-lived processes (python -c "import weightslab")
  wait up to 3 s for the HTTP ping before exiting
- Add WL_TELEMETRY_DEBUG=1 to print ping success/failure instead of silently swallowing

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Move the telemetry hook to after the __version__ block so the variable
exists when ping_import() is called.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- First-run notice printed to stderr once (flag stored in ~/.weightslab/telemetry_noticed)
- Notice explains what is/isn't collected and how to opt out
- Skipped in CI and after the first time it has been shown
- README telemetry section added with opt-out instructions

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@guillaume-byte guillaume-byte merged commit 274f000 into v1.2.3---UI-Optimization-and-new-features Jun 25, 2026
7 checks passed
@guillaume-byte guillaume-byte deleted the telem_info branch June 25, 2026 16:00
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