Skip to content

feat(telemetry): respect DO_NOT_TRACK opt-out#1517

Open
season179 wants to merge 1 commit into
rtk-ai:developfrom
season179:feat/telemetry-do-not-track
Open

feat(telemetry): respect DO_NOT_TRACK opt-out#1517
season179 wants to merge 1 commit into
rtk-ai:developfrom
season179:feat/telemetry-do-not-track

Conversation

@season179
Copy link
Copy Markdown

Summary

  • Honor the standard DO_NOT_TRACK environment variable as a telemetry opt-out.
  • Keep the existing RTK_TELEMETRY_DISABLED=1 behavior unchanged.
  • Show the active env override in rtk telemetry status and document the new opt-out in telemetry docs.

Fixes #1514

Behavior

Telemetry is now blocked when either of these environment variables is set:

RTK_TELEMETRY_DISABLED=1
DO_NOT_TRACK=true  # also accepts DO_NOT_TRACK=1

DO_NOT_TRACK=true is case-insensitive and trims surrounding whitespace. Non-truthy values such as false, 0, yes, no, and empty strings do not block telemetry.

Test plan

  • rtk cargo +1.92.0 fmt --all -- --check
  • rtk cargo +1.92.0 clippy --all-targets (passes with pre-existing warnings in unrelated files)
  • rtk cargo +1.92.0 test telemetry_env_override
  • rtk git diff --check
  • Manual: DO_NOT_TRACK=1 rtk cargo +1.92.0 run --quiet -- telemetry status reports env override: DO_NOT_TRACK (blocked)
  • Manual: RTK_TELEMETRY_DISABLED=true rtk cargo +1.92.0 run --quiet -- telemetry status does not report an env override, preserving the existing exact =1 RTK-specific behavior

Full suite note

rtk cargo +1.92.0 test was run, but the full suite fails in unrelated existing areas:

  • cmds::cloud::curl_cmd::tests::{test_filter_curl_long_output_truncated,test_filter_curl_multibyte_boundary,test_filter_curl_exact_500_bytes} fail because the result no longer contains bytes total.
  • Six core::tracking tests fail with unable to open database file while creating the tracker.

The new telemetry env override tests pass independently.

@season179 season179 marked this pull request as ready for review April 25, 2026 08:34
@pszymkowiak pszymkowiak added effort-small Quelques heures, 1 fichier enhancement New feature or request labels Apr 25, 2026
@pszymkowiak
Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

Type feature
🟢 Risk low

Summary

Adds support for the standard DO_NOT_TRACK environment variable as a telemetry opt-out mechanism, alongside the existing RTK_TELEMETRY_DISABLED=1 behavior. The implementation accepts '1' or 'true' (case-insensitive, whitespace-trimmed) and surfaces the active env override in rtk telemetry status. Documentation is updated across multiple files.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1514


Analyzed automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort-small Quelques heures, 1 fichier enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants