# l4 telemetry

> Opt in or out of crash telemetry, what a crash report carries, what is scrubbed from it, and why some builds send nothing even after you opt in.

Source: https://docs.levelfour.ai/cli/commands/telemetry


`l4 telemetry` controls whether the CLI sends panic stack traces and the failing command name to LevelFour. It is **off by default**. You opt in once with `l4 telemetry enable` and the setting survives upgrades.

```bash
l4 telemetry enable
l4 telemetry disable
l4 telemetry status
```

## What gets sent

When telemetry is enabled and the CLI crashes:

* The panic stack trace
* The Cobra command name that triggered the panic (e.g. `recommendations list`)
* The CLI version and platform string

That is it. No flag values, no arguments, no environment, no file paths beyond what the stack trace itself contains.

## What gets scrubbed before transport

A scrubber runs over every event before it leaves the process:

* Home directory paths are rewritten to `~`
* AWS access key IDs and secret access keys are redacted
* Known token environment variables (`LEVELFOUR_TOKEN`, `GITHUB_TOKEN`, etc.) are redacted from event tags
* All HTTP request headers and cookies are stripped

## Where the setting lives

The opt-in flag is stored in your CLI config alongside settings managed by [`l4 config`](/cli/commands/config). It is not exported by `l4 config list`. Use `l4 telemetry status` to read it.

## When telemetry is silently a no-op

Crash reports only flow when **both** conditions hold:

* You ran `l4 telemetry enable`, and
* The binary was built with a Sentry DSN baked in via release-time `-ldflags`.

> **Note**
>
> Binaries built locally with `go install` or `go build` have an empty DSN and will never send anything, even if you opt in.

Only the official release builds (from Homebrew, GitHub Releases, or `go install`'s package proxy at a tagged version) carry the DSN.

> **Success**
>
> Both conditions holding is the working state: `l4 telemetry status` reports enabled, and the binary is an official release build. A crash then reaches us.

## Examples

Check the current state in a script:

```bash
if l4 telemetry status | grep -q enabled; then
  echo "Telemetry is on"
fi
```

## Related

* [`l4 config`](/cli/commands/config): adjacent settings (default provider, default format, etc.)
* [Reporting issues](/cli#reporting-issues): where to file a CLI bug when the crash is reproducible
