Skip to content

Migrate analytics to brew.sh proxy - #23639

Merged
SMillerDev merged 1 commit into
mainfrom
feat/analytics/migrate_brew_proxy
Aug 24, 2026
Merged

Migrate analytics to brew.sh proxy#23639
SMillerDev merged 1 commit into
mainfrom
feat/analytics/migrate_brew_proxy

Conversation

@SMillerDev

@SMillerDev SMillerDev commented Aug 24, 2026

Copy link
Copy Markdown
Member

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • []x Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

This migrates the analytics reporting to our own proxy so we have more control over it. Also makes it easier to find out for people what the traffic is. Since our proxy automatically sets a write-only token we will not need to set one anymore here.

Copilot AI lite review requested due to automatic review settings August 24, 2026 14:24

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you confirm you've run this locally with export HOMEBREW_ANALYTICS_DEBUG=1 and it produces identical output (bar the URL) to the previous approach?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Homebrew’s analytics reporting endpoint to the analytics.brew.sh proxy and removes the previously hard-coded InfluxDB token from the client-side implementation.

Changes:

  • Switch Utils::Analytics::INFLUX_HOST to https://analytics.brew.sh.
  • Remove the Authorization: Token ... header from analytics write requests.
  • Update formula-analytics spec expectations for the new host value.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/utils/analytics.rb Updates the Influx host to the brew.sh proxy and removes the Authorization token header from write requests.
Library/Homebrew/test/dev-cmd/formula-analytics_spec.rb Adjusts expected query request host to match the new INFLUX_HOST value.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/utils/analytics.rb
@SMillerDev

Copy link
Copy Markdown
Member Author

Can you confirm you've run this locally with export HOMEBREW_ANALYTICS_DEBUG=1 and it produces identical output (bar the URL) to the previous approach?

I've checked both the normal write flow and brew formula-analytics. Both still seem to be working as before. And the request output differs only in header, commit and URL.

@MikeMcQuaid

Copy link
Copy Markdown
Member

Thanks!

@SMillerDev
SMillerDev added this pull request to the merge queue Aug 24, 2026
Merged via the queue into main with commit 2e32c67 Aug 24, 2026
47 of 48 checks passed
@SMillerDev
SMillerDev deleted the feat/analytics/migrate_brew_proxy branch August 24, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants