Page MenuHomePhabricator

Set up Javascript error dashboard for Growth team
Open, Needs TriagePublic


The Growth team has a Logstash dashboard which identifies PHP errors likely related to code maintained by the team, by filtering on namespace names in stack traces. It would be nice to have something similar for JS errors. Unfortunately, file names in JS stack traces are not useful due to ResourceLoader minification (fixing that is T47514: ResourceLoader: Implement support for Source Maps but it requires a lot of work), so the easy approach of matching Growth-maintained extensions' script roots to the stack trace doesn't work. Things that we could try instead:

  • For extensions where most features are related to a special page (such as Special:Homepage for GrowthExperiments), filter for errors happening on that page. This would require T266504: Include canonical special page name for JS error reports.
  • Get a list of all classes used in our code (probably doable with consistent jsdoc annotations and some simple regex), and match all errors where that class name appears in the stack trace. Class names are not unique, but in practice they might be unique enough. This wouldn't capture errors happening outside classes or in standalone functions, but there's not that many of those, and they could be refactored away relatively easily.

Event Timeline

Each of those could probably be done in a day or so (including the linked task, in the first case). The first would only catch errors on the homepage (but would catch all of those). The second would need a long tail of code refactorings to be fully effective - not sure how many errors it would catch as it is now.

All the existing Growth bugs that I am aware of are filtered via The Growth (DSL) query on the mw-client-error board. The query might help!:

I think this is unblocked now. @Tgr I setup

Feel free to discard in favor of something different and happy to tweak it if it doesn't quite cover your needs.