Skip to main content

is_telemetry_disabled

Function is_telemetry_disabled 

Source
pub fn is_telemetry_disabled() -> bool
Expand description

Check if telemetry is disabled via environment variables.

Telemetry is disabled when:

  • SOCKET_TELEMETRY_DISABLED is "1" or "true" (legacy SOCKET_PATCH_TELEMETRY_DISABLED still honored with warning)
  • VITEST is "true" (test environment)
  • SOCKET_OFFLINE is "1" or "true" (airgap mode — the telemetry endpoint is a network call, so honoring --offline/SOCKET_OFFLINE here keeps every command compliant with the strict-airgap contract)

Note that the CLI also exposes a --no-telemetry flag; when that flag is set the CLI dispatcher sets SOCKET_TELEMETRY_DISABLED=1 for the duration of the process so this check stays the single source of truth.