We need our own source of error rates in the Yarn client, especially around HTTP errors. We should use https://sentry.io/ or something. This way we can diagnose problems with the registry.
This is a great idea. We should probably allow opting out for privacy reasons and also only log for registry.yarnpkg.com and registry.npmjs.com (ie. do not log for private/internal repositories), but I think collecting error rates will be hugely beneficial. Given we shouldn't really be encountering many errors, I could even just throw an endpoint onto nightly.yarnpkg.com that logs into a database if that works best, or we could use Google Analytics. Sentry's lowest plan might be fine too.
I would say it should just prompt the user the first time they run Yarn on a machine, and not log if your package.json has "private": true or (as you said) if you have a custom registry.
I would say it should just prompt the user the first time they run Yarn on a machine
Nice idea. This sounds great for interactive use. What if Yarn is running as part of a CI build though? Should we just enable it by default if there's no tty? I feel like that's where we could get a lot of useful data as CI builds run very frequently so there's more likelihood of getting useful data.
If we do it by default in CI we should have a way of disabling it there too or CI services are probably going to turn it off manually and we'll get nothing. I'm thinking we should add a config option to .yarnrc which can be added to your repo.
I noticed this while installing Linuxbrew (which is a fork of Homebrew):
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
http://docs.brew.sh/Analytics.html
This seems like a reasonable approach - Having it enabled by default, and very clearly explaining how to opt-out on installation or on first run.
Most helpful comment
I would say it should just prompt the user the first time they run Yarn on a machine, and not log if your
package.jsonhas"private": trueor (as you said) if you have a custom registry.