Files
brew/docs/Analytics.md
T
Mike McQuaid 5da7b049b0 Sample only user-set env config in analytics
- The formulae.brew.sh env-config table was hard to interpret: unset
  and explicitly-set-to-default runs were merged as "default events",
  nothing showed what a variable's default was and variables brew
  exports itself (`HOMEBREW_UPDATE_TO_TAG` in `cmd/update.sh`,
  `HOMEBREW_EDITOR`/`HOMEBREW_DISPLAY` etc. copied from the user
  environment in `bin/brew`) dominated the chart as fake user
  configuration.
- Record `HOMEBREW_USER_SET_VARS` at `bin/brew` startup, after
  `brew.env` files load but before any exports, so sampling and
  `brew config` can tell deliberate configuration apart; sub-brews
  inherit the list.
- Replace the `env_config_non_default` tag with a single
  `env_config_state` tag (`unset`/`default`/`non_default`) computed
  from user-set values only.
- Compute previously `default_text`-only defaults so explicitly-set
  default values are ignored everywhere: `HOMEBREW_AUTO_UPDATE_SECS`
  (mirroring `brew.sh`), `HOMEBREW_FORBID_PACKAGES_FROM_PATHS` (now
  `boolean: :set`, matching its accessor), `HOMEBREW_PIP_INDEX_URL`
  and `HOMEBREW_SSH_CONFIG_PATH`; generated accessors and
  `non_default_variable?` call callable defaults and treat blank
  booleans as unset like their accessors.
- `brew config` now only prints user-set non-default variables and
  `Resource#determine_url_mirrors` only rewrites PyPI URLs for
  non-default `$HOMEBREW_PIP_INDEX_URL` values.
- Sanitise `formula-analytics` results: only current variables and
  valid states are accepted and the query requires the new tag,
  which drops the contaminated data already collected.
- Stop excluding CI events from `command_run_options`: CI users are
  normal users so CI-only usage should stay visible.
- Output `non_default_count`, `set_default_count`, `unset_count` and
  `default_value` per variable in JSON, using the human
  `default_text` summary for varying defaults via
  `EnvConfig.default_description`, now shared with the manpage.
2026-07-24 19:40:08 +01:00

3.2 KiB

last_review_date
last_review_date
2026-07-18

Anonymous Analytics

Homebrew collects aggregate, anonymous usage analytics in InfluxDB. Homebrew displays a notice before analytics are enabled so a user can opt out before sending an event.

Purpose

The data helps maintainers prioritise widely used formulae, casks, commands and supported platforms. It also shows where installation or build failures are concentrated and whether a feature is used enough to justify its maintenance cost.

Analytics must not replace technical evidence or maintainer judgement. Low usage alone does not establish that removing a command or package is safe.

Retention

Homebrew retains analytics events in InfluxDB for 365 days. Public aggregate reports may cover shorter periods.

Data sent

Formula, cask and build-error events can include:

  • the package and non-private GitHub tap names
  • selected install options
  • whether the install was explicitly requested rather than installed as a dependency
  • whether Homebrew is running in CI, developer mode or after a developer command has been used
  • CPU architecture and operating system name or major version
  • Homebrew version
  • whether Homebrew uses its default prefix, with every other prefix reported only as custom-prefix

Command events include the command and option names after option values have been removed. For selected common commands, Homebrew randomly samples one supported configuration variable and records its name and whether the user left it unset, set it to its default or set it to a non-default value; variables Homebrew exports itself (e.g. HOMEBREW_EDITOR from EDITOR) count as unset. It does not record the variable's value.

BrewTestBot can send CI-only test-step results when its analytics setting is enabled. Build-error events do not include build logs or exception details.

The analytics payload does not contain a user identifier or an IP-address field. Homebrew does not use the payload to build a history for an individual user.

The current implementation is in analytics.rb and analytics.sh. These files are the authoritative source when this page and the implementation differ.

Inspecting analytics

Set HOMEBREW_ANALYTICS_DEBUG=1 for one command to print the analytics request and send it synchronously. The server response is discarded, so no response output is shown. Debug mode is not an opt-out mechanism; use one of the settings below when the request must not be sent.

Aggregate reports and their JSON representations are available from the Homebrew analytics site. Most Homebrew maintainers have access only to these public aggregates.

Transport and failure behaviour

Homebrew sends analytics to InfluxDB over HTTPS in a detached background process. The request has a short timeout and failures are silent so analytics do not delay or prevent the requested Homebrew operation.

Opting out

Disable analytics persistently with:

brew analytics off

Alternatively, set the environment variable:

export HOMEBREW_NO_ANALYTICS=1

Run brew analytics state to inspect the current setting.