Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the analytics that are collected in Gradio #8263

Merged
merged 8 commits into from
May 13, 2024

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented May 11, 2024

Remove Google Analytics from Gradio apps and document the analytics that we do track from developers.

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented May 11, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website failed! Details
Storybook ready! Storybook preview
🦄 Changes detecting...

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/840b6bef9cd79a01d3e0ab887f0c3e6ae3379d5c/gradio-4.31.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@840b6bef9cd79a01d3e0ab887f0c3e6ae3379d5c#subdirectory=client/python"

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented May 11, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/app patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Reduce the analytics that are collected in Gradio

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@@ -324,6 +324,7 @@ def test_upload_and_download_with_auth(self):
with open(output) as f:
assert f.read() == "Hello file!"

@pytest.mark.flaky
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated but this is a flaky test and I'm not sure why

@abidlabs abidlabs marked this pull request as ready for review May 13, 2024 20:03
@freddyaboulton
Copy link
Collaborator

Looks great @abidlabs !

@@ -464,3 +465,17 @@ demo.launch(max_file_size=5 * gr.FileSize.MB)
```

Please make sure you are running the latest version of `gradio` for these security settings to apply.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Personally think this is way too much content about analytics in the getting started guide @abidlabs

Copy link
Member Author

Choose a reason for hiding this comment

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

This guide is no longer in the getting started section :)

@freddyaboulton freddyaboulton added v: patch A change that requires a patch release labels May 13, 2024
@freddyaboulton freddyaboulton enabled auto-merge (squash) May 13, 2024 22:56
@freddyaboulton freddyaboulton merged commit de52f0e into main May 13, 2024
8 checks passed
@freddyaboulton freddyaboulton deleted the reduce-analytics branch May 13, 2024 23:10
@pngwn pngwn mentioned this pull request May 13, 2024
* What environment the Gradio app is running on (e.g. Colab Notebook, Hugging Face Spaces)
* What input/output components are being used in the Gradio app
* Whether the Gradio app is utilizing certain advanced features, such as `auth` or `show_error`
* The IP address which is used solely to measure the number of unique developers using Gradio
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe more precise The IP address of the server?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah let me fix in another pr

Copy link
Contributor

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

nice!

@RemiCardona
Copy link

I'll add my own 2 euro-cents here.

First of all, this PR is a step in the right direction with at least some documentation of the tracking done by gradio and ways to mitigate that.

But the documentation is misleading. Simply importing gradio will trigger home-phoning HTTP calls (done on 4.31.0 which my team currently has pinned, but main still has the code):

$ python
Python 3.11.9 (main, May  4 2024, 11:48:10) [GCC 13.2.1 20240210] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig(level="INFO")
>>> logging.getLogger("httpx").setLevel("INFO")
>>> import gradio
INFO:httpx:HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
>>> 

This is done here

gradio/gradio/strings.py

Lines 39 to 40 in b67f7ff

if os.getenv("GRADIO_ANALYTICS_ENABLED", "True") == "True" and not wasm_utils.IS_WASM:
threading.Thread(target=get_updated_messaging, args=(en,)).start()
in top-level code, that is only controlled through the GRADIO_ANALYTICS_ENABLED environment variable.

This is incredibly poor taste (importing code should hardly ever do anything, let alone do HTTP calls) and a massive GDPR violation as consent was never given for such data collection.

IMHO gradio should come free of all external calls, the environment variable should simply not exist. There are many ways to collect insightful usage of gradio without compromising basic privacy: user surveys advertised through x/twitter, github, newsletters, etc.

The analytics code could be kept around but in a separate package, the way Debian does it:

Thanks for reading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants