Set up Sentry-based(?) logging of client-side JS errors in VE so we can find and fix them
Open, NormalPublic8 Story Points

Description

As chatted with Ed about.

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 12 2016, 10:45 AM

@MarkTraceur, mind if Ed picks your brains about how this works and how he can set it up?

Apparently @matmarex is the expert; Bartosz, can we steal some of your time?

matmarex added a subscriber: Tgr.Jun 14 2016, 3:32 PM

I think Sentry is still vaporware? I heard @Tgr is planning to work on it at some point in the future, when everything AuthManager-related is completely tied up.

UploadWizard logs client-side JS errors using a simple EventLogging schema (https://meta.wikimedia.org/wiki/Schema:UploadWizardExceptionFlowEvent) and core's 'global.error' event, which was actually developed for Sentry, I think (resources/src/mediawiki/mediawiki.errorLogger.js). The actual code is just a couple lines (uw.EventFlowLogger.js#L178-L186 and #L87-L91). You can view the data in the UploadWizardExceptionFlowEvent_11772722 table on stat1003.

Unfortunately this gives us rather limited information. The error messages are also wildly inconsistent between browsers, even for the same issue, and often arrive localized to the user's language. We get error messages from crappy browser extensions. There are also no stack traces, just the error message. (T136230 has some analysis. It's still a lot better than nothing.)

The last part is because the length of data you can log via EventLogging is severely limited (our code comments reference T91347, but even with that fixed, there's a hardcoded limit on the URL length of 2000 characters: ext.eventLogging.core.js#L57). If you develop some method of compressing/simplifying the stack traces (it might be a bit of a pain because of browser inconsistencies), or splitting them between multiple log events (probably easier, just a chore to write), I'd probably want to use it in UploadWizard too.

Tgr added a comment.Jun 14 2016, 4:09 PM

I think Sentry is still vaporware? I heard @Tgr is planning to work on it at some point in the future, when everything AuthManager-related is completely tied up.

I'll probably get back to it after Wikimania.

The error messages are also wildly inconsistent between browsers, even for the same issue, and often arrive localized to the user's language.

Only logging the error when the browser language is English would probably help to cut down the noise.

If you develop some method of compressing/simplifying the stack traces (it might be a bit of a pain because of browser inconsistencies), or splitting them between multiple log events (probably easier, just a chore to write), I'd probably want to use it in UploadWizard too.

Minified stack traces are not useful. https://gerrit.wikimedia.org/r/#/c/156544/ might help on some browsers; the generic solution would be T47514: ResourceLoader: Implement support for Source Maps.

Jdforrester-WMF removed Esanders as the assignee of this task.Mar 25 2017, 3:23 AM
Jdforrester-WMF added a subscriber: Esanders.