gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.61k stars 2.27k forks source link

Adds a monitoring dashboard to Gradio apps that can be used to view usage #8478

Closed aliabid94 closed 3 weeks ago

aliabid94 commented 3 weeks ago

This PR adds an analytics dashboard to show all requests processed by the queue and their status. To visit this dashboard, go to the /analytics endpoint. This print a secret URL to the console that you can visit to see the actual analytics dashboard.

Screenshot 2024-06-06 at 6 26 41 AM
gradio-pr-bot commented 3 weeks ago

🪼 branch checks and previews

• Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
:unicorn: Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/c03269a6da2cb3e12a7716dcab2115655463867e/gradio-4.33.0-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/c03269a6da2cb3e12a7716dcab2115655463867e/gradio-client-1.1.0.tgz
gradio-pr-bot commented 3 weeks ago

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor

With the following changelog entry.

Adds a monitoring dashboard to Gradio apps that can be used to view usage

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](https://github.com/gradio-app/gradio/edit/analytics_dashbaord/.changeset/common-paws-grab.md).
abidlabs commented 3 weeks ago

2 high-level points @aliabid94:

aliabid94 commented 3 weeks ago

Instead of going to /analytics which prints a secret token, I think it would make more sense to have a parameter in launch() called enable_monitoring which if set to True, prints the url to the dashboard on launch.

Disagree, because if your app prints a lot to console, you will lose the URL deep into console history. Also people will forget to enable it before launching an app, and then lose access to analytics.

abidlabs commented 3 weeks ago

Ok I see what you mean. I still think we should another word than "analytics" like "monitoring"

aliabid94 commented 3 weeks ago

changed to "monitoring"

abidlabs commented 3 weeks ago

Nit: got this printed in the console:

/Users/abidlabs/dev/gradio-repos/gradio/gradio/analytics_dashboard.py:63: FutureWarning: 'T' is deprecated and will be removed in a future version, please use 'min' instead.