Page MenuHomePhabricator

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

Description

As chatted with Ed about.

Event Timeline

@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?

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.

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.

Deskana lowered the priority of this task from Medium to Low.Aug 16 2018, 2:55 PM
Deskana moved this task from TR0: Interrupt to Freezer on the VisualEditor board.
Jdlrobson claimed this task.
Jdlrobson subscribed.

This looks resolved to me. Please feel free to reopen if I've missed something but these are now coming in thick and fast on logstash.