feat: anonymous telemetry ping (1/day, opt-out)#334
Merged
pszymkowiak merged 3 commits intomasterfrom Mar 5, 2026
Merged
Conversation
Fire-and-forget daily ping to track active installs for BPI metrics. - SHA-256 device hash (hostname:user), no PII - Opt-out: RTK_TELEMETRY_DISABLED=1 or config.toml [telemetry] enabled=false - Token injected at compile time via option_env!, not in source - 23h throttle via marker file, 2s timeout, non-blocking thread
All 3 build jobs (binary, DEB, RPM) now receive the token from GitHub secrets so option_env!() compiles it into release binaries.
Contributor
|
ok pour moi, peut-être certaines constantes que tu préfèrerais avoir en dehors du code |
aeppling
approved these changes
Mar 5, 2026
URL and token are both injected at compile time — no hardcoded server address in source code. Builds without the env var simply skip telemetry silently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /telemetryfor BPI usage metricsoption_env!()— not in source codeOpt-out
RTK_TELEMETRY_DISABLED=1[telemetry] enabled = falsein~/.config/rtk/config.tomlImplementation
src/telemetry.rs: core module (maybe_ping, device hash, marker file throttle)src/config.rs: TelemetryConfig structsrc/tracking.rs: 3 new DB query helpers (count_commands_since, top_commands, overall_savings_pct)src/main.rs: call maybe_ping() at startup.github/workflows/release.yml: injectRTK_TELEMETRY_TOKENsecret in all 3 build jobsDesign
Test plan
cargo test— 609 passcargo clippy— 0 new warningsRTK_TELEMETRY_DISABLED=1works (no marker created)GET /telemetry/stats(admin endpoint on rtk-api)