You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(telemetry): honor opt-out env vars without contacting PostHog π€π€π€π€ (#2787)
* fix(telemetry): honor opt-out env vars without contacting PostHog
Re-read GISKARD_TELEMETRY_DISABLED and DO_NOT_TRACK on capture (including
cwd .env and quoted values), and pass send=False so a firewalled process
never opens eu.i.posthog.com after opt-out.
Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
* simplify code
* add more tests
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Kevin Messiaen <kevinmessiaen@users.noreply.github.com>
Co-authored-by: Henrique Chaves <44180294+henchaves@users.noreply.github.com>
Co-authored-by: Henrique Chaves <henrique@giskard.ai>
**Telemetry:** optional aggregated analytics via `giskard-core`. No prompts or outputs are sent.
47
-
Opt out **before importing Giskard**: `export DO_NOT_TRACK=1` or `export GISKARD_TELEMETRY_DISABLED=1`.
47
+
Opt out with `export DO_NOT_TRACK=1` or `export GISKARD_TELEMETRY_DISABLED=1` (or the same keys in a `.env` file in the working directory). Set them before import to skip creating `~/.giskard/id`; setting them later still stops further sends.
Copy file name to clipboardExpand all lines: libs/giskard-core/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,13 @@ A random **persistent ID** may be stored under `~/.giskard/id` so repeated sessi
31
31
32
32
### How to disable telemetry
33
33
34
-
Set any of these environment variables to a truthy value **before** importing `giskard` packages (values are matched case-insensitively; common examples: `1`, `true`, `yes`, `on`):
34
+
Set any of these environment variables to a truthy value (matched case-insensitively; wrapping quotes are ignored; common examples: `1`, `true`, `yes`, `on`):
35
35
36
36
-`DO_NOT_TRACK`
37
37
-`GISKARD_TELEMETRY_DISABLED`
38
38
39
+
Flags are read from the **process environment** and from a **`.env` file in the working directory** (process env wins). Set them **before importing** Giskard packages to skip creating `~/.giskard/id` and to never start the analytics sender. If you set them later, further events are dropped and the sender is stopped so **no requests are made** to PostHog (including in environments that block `eu.i.posthog.com`).
40
+
39
41
You can also call `disable_telemetry()` from `giskard.core` at runtime to turn off further sends for that process (for example from test harnesses). That does not remove `~/.giskard/id` if it was already created; use env-based opt-out before import to avoid writing the file.
40
42
41
43
```python
@@ -48,7 +50,7 @@ disable_telemetry()
48
50
49
51
When telemetry is **enabled**, PostHog may apply **GeoIP** enrichment to events (server-side location metadata used in dashboards). That enrichment is **off** whenever telemetry is fully disabled (see above) or when you call `disable_telemetry()`.
50
52
51
-
To **keep usage analytics** but **disable GeoIP only**, set this environment variable to a truthy value **before** importing Giskard packages (same matching rules as in [How to disable telemetry](#how-to-disable-telemetry)):
53
+
To **keep usage analytics** but **disable GeoIP only**, set this environment variable to a truthy value (same matching rules and `.env` behavior as in [How to disable telemetry](#how-to-disable-telemetry)):
0 commit comments