Page MenuHomePhabricator

Add sampling and throttling support to JS error logging
Open, NormalPublic

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 created this task.Oct 1 2014, 12:48 PM
Tgr updated the task description. (Show Details)
Tgr raised the priority of this task from to Normal.
Tgr claimed this task.
Tgr changed Security from none to None.
Tgr added a subscriber: Tgr.
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

Tgr added a comment.Mar 17 2015, 3:54 AM

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

Tgr edited projects, added Sentry; removed Patch-For-Review, Multimedia.Aug 6 2015, 5:12 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 6 2015, 5:12 PM

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