From 3985804089b603ce4f6a3607c5e0a2f853c09ce4 Mon Sep 17 00:00:00 2001 From: lukeocodes Date: Thu, 7 May 2026 22:58:24 +0100 Subject: [PATCH] docs(telemetry): document opt-out in README; drop web toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The web toggle gated only the marketing site's own Sentry init via localStorage — it could never affect the locally-installed CLI's telemetry, since they run in different processes on different machines. Removing it (and the now-dead localStorage check) so Sentry init on cli.deepgram.com is unconditional for visitors. Documenting all three CLI opt-out paths in the main README only: - dg config set telemetry.enabled false (persistent) - DEEPCTL_TELEMETRY_DISABLED=1 (one-shot / CI) - DEEPCTL_TELEMETRY_DSN (fork / self-hosted override) The --help footer keeps pointing at the config command for in-terminal discoverability. --- README.md | 32 ++++++++++++++++++++++++++++++++ web/sentry.client.config.ts | 23 ++++++++--------------- web/src/pages/index.astro | 26 -------------------------- 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 757465e..70d7707 100644 --- a/README.md +++ b/README.md @@ -321,6 +321,38 @@ dg profiles --switch staging # Switch profile Output format on any command: `--output json|yaml|table|csv` +## Telemetry + +The CLI phones home anonymous error reports to help us catch crashes and regressions before users have to file an issue. It's **on by default** and easy to turn off. + +**What's collected:** Python exceptions, stack traces, the CLI version, and the Python runtime. Request bodies, headers, cookies, API keys, email addresses, IP addresses, and usernames are scrubbed before send. No performance traces, no profiling, no replays — errors only. + +**Where it goes:** the `dx-cli` Sentry project owned by the Deepgram DX team. + +### Opt out + +Persistent (recommended): + +```bash +dg config set telemetry.enabled false +``` + +One-shot (CI, scripts, single command): + +```bash +DEEPCTL_TELEMETRY_DISABLED=1 dg listen recording.wav +``` + +### Override the destination + +For forks or self-hosted Sentry, point telemetry at your own DSN: + +```bash +export DEEPCTL_TELEMETRY_DSN='https://@/' +``` + +`DEEPCTL_TELEMETRY_DISABLED` always wins. The default DSN is baked into the package and only used when the override is unset. + ## Development ```bash diff --git a/web/sentry.client.config.ts b/web/sentry.client.config.ts index 35adc4e..fd0bd73 100644 --- a/web/sentry.client.config.ts +++ b/web/sentry.client.config.ts @@ -1,17 +1,10 @@ import * as Sentry from '@sentry/astro'; -const STORAGE_KEY = 'dg_telemetry'; -const optedOut = - typeof window !== 'undefined' && - window.localStorage?.getItem(STORAGE_KEY) === 'off'; - -if (!optedOut) { - Sentry.init({ - dsn: 'https://d7a2aabbf772218e3bbe89266999af70@o206115.ingest.us.sentry.io/4510993603362816', - environment: import.meta.env.PROD ? 'production' : 'development', - sendDefaultPii: false, - tracesSampleRate: 0, - replaysSessionSampleRate: 0, - replaysOnErrorSampleRate: 0, - }); -} +Sentry.init({ + dsn: 'https://d7a2aabbf772218e3bbe89266999af70@o206115.ingest.us.sentry.io/4510993603362816', + environment: import.meta.env.PROD ? 'production' : 'development', + sendDefaultPii: false, + tracesSampleRate: 0, + replaysSessionSampleRate: 0, + replaysOnErrorSampleRate: 0, +}); diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index 554c3ca..ce2397a 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -862,10 +862,6 @@ const commandCards: CommandCard[] = [
© {new Date().getFullYear()} Deepgram, Inc. All rights reserved. - - Telemetry: on - -
@@ -1103,26 +1099,4 @@ const commandCards: CommandCard[] = [ (window as any).switchInstall = switchInstall; (window as any).copyInstall = copyInstall; (window as any).copyCmd = copyCmd; - - // ── Telemetry opt-out toggle ───────────────────────────────── - // Reads/writes the `dg_telemetry` localStorage flag. Sentry init - // in sentry.client.config.ts checks the same flag on page load. - (() => { - const STORAGE_KEY = 'dg_telemetry'; - const stateEl = document.getElementById('dg-tel-state'); - const toggleEl = document.getElementById('dg-tel-toggle'); - if (!stateEl || !toggleEl) return; - const render = () => { - const off = localStorage.getItem(STORAGE_KEY) === 'off'; - stateEl.textContent = off ? 'off' : 'on'; - }; - toggleEl.addEventListener('click', () => { - const off = localStorage.getItem(STORAGE_KEY) === 'off'; - if (off) localStorage.removeItem(STORAGE_KEY); - else localStorage.setItem(STORAGE_KEY, 'off'); - render(); - location.reload(); - }); - render(); - })();