Page MenuHomePhabricator

Decorate mediawiki.api_request events with experiment enrollment information
Open, HighPublic5 Estimated Story Points

Description

Background

Soon after the change for T409965: Enable experiment enrollment in the MediaWiki Action API was deployed to group1 wikis, there was a spike in validation errors on the mediawiki.api_request stream. In response, we (temporarily) disabled adding experiment enrollment information to the global logging context for MediaWiki Action API requests. This means that experiment enrollment information is not included in any lines logged during an API request.

Why did this happen?

This happened because API requests are sent as events to the stream via the Monolog logging library and we starting adding experiment enrollment information to the global logging context, which is mixed into all log lines. This information was added to the events sent to the stream, triggering a validation error.

AC

  • We determine if the mediawiki.api_request stream is required
  • The /mediawiki/api/request/1.0.0 schema is updated to include an context.ab_tests property (or, make it not fail when adding context.ab_tests)
  • We re-enable adding experiment enrollment information to the global logging context for MediaWiki Action API requests

Notes

  1. This will happen again when another developer adds to the global logging context. The schema should be made more resilient

Event Timeline

JVanderhoop-WMF subscribed.

What is the impact of not doing? What teams would this block (and in what time frame)?

Relevant docs: https://wikitech.wikimedia.org/wiki/Data_Platform/Data_Lake/Traffic/mediawiki_api_request

What is the impact of not doing? What teams would this block (and in what time frame)?

@JVanderhoop-WMF: I've updated the task to highlight that this impacts all logging during API requests and not just logging that ends up with an event flowing on the mediawiki.api_request stream. The impact of not fixing this is that there's no insight into which experimental treatments were assigned during a MediaWiki Action API request.

@phuedx and this would be particularly bad for Growth's future experiments (Revise tone structured task, slated for Jan), correct?

JVanderhoop-WMF updated the task description. (Show Details)
JVanderhoop-WMF set the point value for this task to 5.

This would also be bad for RelEng and SRE when they're trying to figure out what's happening for a set of API requests. This reduces the overall observability of they system.