JS error logging should be able to gracefully handle the case when there is an error in JS code which runs on every page (or even lots of times for every page - e.g. error in scroll handler), and the server is swamped by error reports.
- add a configuration option to sample error reports (i.e. the JS module doing the logging should toss a coin to decide whether it does any logging)
- add a configuration option to throttle error reports per page (i.e. the JS object doing the logging should have an error counter and ignore all further errors once it reaches some specified value)
- if possible, add a configuration option to throttle error reports globally, such as <N reports per minute (this would involve some sort of throttling in the API and varnish endpoints, in T500 and T501 repsectively)