Page MenuHomePhabricator

Add sampling and throttling support to JS error logging
Closed, DeclinedPublic

Description

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)

Event Timeline

Tgr claimed this task.
Tgr raised the priority of this task from to Medium.
Tgr updated the task description. (Show Details)
Tgr changed Security from none to None.
Tgr subscribed.
Tgr removed Tgr as the assignee of this task.Jan 30 2015, 2:38 AM

Change 188328 had a related patch set uploaded (by Gergő Tisza):
Wrap asynchronous callbacks with error logging

https://gerrit.wikimedia.org/r/188328

Also needs some way to limit logging to certain pages, for gradual rollout. (The plan is to start with Special:UploadWizard which only gets a few thousand hits a day, but has a fair amount of errors, although we don't know for sure if they are JS errors or something else.)

https://gerrit.wikimedia.org/r/#/c/188328/ adds a ResourceLoaderGetConfigVars variable ($wgRegisterJavascriptErrorLogging). I've tested locally and it seems a MakeGlobalVariablesScript can override a ResourceLoaderGetConfigVars hook for the same variable, so that also takes care of selective enabling from the UW extension.

Change 188328 abandoned by Gergő Tisza:
Wrap asynchronous callbacks with error logging

Reason:
Abandoning, see T92247#1147500. Might be revisited later.

https://gerrit.wikimedia.org/r/188328

Change 229986 had a related patch set uploaded (by Gergő Tisza):
Limit Sentry calls to 5 per page load

https://gerrit.wikimedia.org/r/229986

Change 229986 merged by jenkins-bot:
Limit Sentry calls to 5 per page load

https://gerrit.wikimedia.org/r/229986

At the time of creating this task it was assumed that the server side implementation of error logging would be based on Sentry. We have eventually decided on a different implementation, so de-tagging.

Aklapper removed a subscriber: wikibugs-l-list.

Declining per previous comment; feel free to reopen if this is still valid/wanted and please add an active project tag so this task can be found - thanks!