> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cli/administration/telemetry-and-privacy.md).

# Telemetry and privacy

The SonarQube CLI collects two kinds of data:

* **Anonymous usage telemetry**: which commands are run, on what platform, and whether they succeeded.
* **Crash reports** via [Sentry](https://sentry.io): unhandled exceptions, scrubbed of personal paths.

Both are enabled by default. They share a single opt-out and transmit no source code, no file contents, and no secrets.

## What telemetry collects

Telemetry helps us understand how the CLI is used so we can prioritize improvements, catch regressions, and decide which platforms and integrations to invest in. At a high level, events capture which commands are run, whether they succeed, the CLI version and operating system, and (when you're authenticated) which SonarQube connection the command ran against. We also record which AI coding agent invoked the CLI when one is detectable, so we can shape the integrations accordingly.

Events are buffered locally in `~/.sonar/sonarqube-cli/state.json` and flushed asynchronously to SonarSource's telemetry endpoint. A stable anonymous user ID (a UUID) is stored separately at `~/.sonar/user` so it can be shared across Sonar products on the same machine. See [State and storage](/sonarqube-cli/administration/state-and-storage.md) for the full on-disk layout.

## What telemetry doesn't collect

* File contents.
* File paths or filenames inside your repositories.
* Project names or keys (only server-side UUIDs).
* Command arguments, flag values, or output.
* Any token or credential value.

## What crash reports contain

Sentry is used for crash reporting only. When the CLI hits an unhandled exception, it sends:

* The exception type and message.
* The stack trace, **with your home directory path scrubbed** before transmission.
* The CLI version and OS.

Crash reports are tied to the same opt-out as telemetry; turning off telemetry also turns off Sentry.

## Disable telemetry and crash reporting

For an individual developer:

```bash
sonar config telemetry --disabled
```

To re-enable:

```bash
sonar config telemetry --enabled
```

The setting persists in `~/.sonar/sonarqube-cli/state.json` (`telemetry.enabled`).

To disable telemetry and crash reporting for the current shell session without changing persisted configuration, set:

```bash
export DO_NOT_TRACK=1
```

## Rolling out an opt-out across a fleet

For a scaled rollout where policy requires telemetry off by default:

* Push `sonar config telemetry --disabled` into your developer-environment bootstrap (Ansible, Chef, dotfiles repo, IT-managed onboarding script). This persists the setting in `state.json` on every machine.
* Or set `DO_NOT_TRACK=1` in your shared developer environment to disable both telemetry and crash reporting without changing persisted configuration.

The opt-out is per-machine. No central org-level switch exists yet.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [State and storage](/sonarqube-cli/administration/state-and-storage.md)
* [Environment variables](/sonarqube-cli/using-sonarqube-cli/environment-variables.md)
* [`sonar config telemetry`](/sonarqube-cli/using-sonarqube-cli/commands.md#sonar-config-telemetry)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-cli/administration/telemetry-and-privacy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
