Page MenuHomePhabricator

Console "stream ... is out of sample. No event will be sent" warnings on every page load
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Open any article on English Wikipedia
  • Open the JavaScript console
  • Reload the page
  • Observe console output

What happens?:

On (nearly) every page load, the console shows warnings such as:

The stream mediawiki.web_ui_actions is out of sample. No event will be sent MediaWikiMetricsClientLogger.js:19:9
The stream mediawiki.client.session_tick is out of sample. No event will be sent MediaWikiMetricsClientLogger.js:19:9
The stream mediawiki.client.session_tick is out of sample. No event will be sent MediaWikiMetricsClientLogger.js:19:9

These messages appear repeatedly for normal page views and they are logged at warning level. It's a lot of noise and makes it harder for developers to notice other issues or debug other problems.

In addition, the The stream mediawiki.client.session_tick is out of sample. No event will be sent message in particular repeats many times on many pages (a dozen or more times).

It looks like this may have been introduced with this change in December:

https://phabricator.wikimedia.org/rMLMP5a5db741aff46ed45b94e73b3474b51ffe25b849

What should have happened instead?:

This should not generate repeated console messages for normal users on production servers.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

  • English Wikipedia

Other information (browser name/version, screenshots, etc.):

  • Firefox 147.0.2

Event Timeline

Thanks for filing! We are interested in striking a balance between ensuring that developers can debug their instrumentation code as needed, and creating too much noise. Do you have any particular suggestions around how to balance this tension?

We'll also reach out to our developer teams to assess how best to ensure they can troubleshoot (i.e. why isn't my instrument sending events?) and raising too much noise for others.

One approach that might help is to scope these messages more to debugging and development contexts:

  • Emit the "out of sample" and other warnings from this code only when a debug flag or development mode is enabled (e.g., via a mw.config option, query parameter, user option, or localStorage setting). Perhaps the debug=true URL parameter would work for this?
  • Keep the more verbose logging on beta and development environments, while suppressing it on production.

That approach works reasonably well for some user scripts I've written:

It also seems like some of these messages are so common in normal usage that perhaps it's a problem worth investigating. Or if this behavior is expected then perhaps it doesn't really need to be logged.

What we're thinking: On TK startup, we compute a list of "here are all of the instruments that are in sample for this page" and cache the results. We will display this once per page. We won't do this every time an instrument sends an event (which can be up to every few seconds with e.g. SessionTick)

This is blocked on T415579

JVanderhoop-WMF moved this task from Incoming to READY TO GROOM on the Test Kitchen board.