Parent task/goal: T397363: Verify instrument configuration with xLab
Background
Before the Experiment Platform team made a deliberate pivot to focus all hands on experimentation, we had built a proof-of-concept xLab (fka MPIC) to provide instrument configuration to MediaWiki, which we dogfed in T373715: MPIC (aka EPIC): Create a plan for dogfooding the alpha release and T366460: [SPIKE] Create a plan for dogfooding MPIC for a test instrument deployed to the Beta Cluster using a one-off CTR instrument in Q1-Q3 of FY24-25. Since that time a lot has changed about xLab and also our thinking around how instruments managed with xLab should work. To support instrumentation managed with xLab, we should tackle some technical debt regarding how the Event Platform, Metrics Platform, and Experimentation Lab fit together.
There was a TDR wherein it was decided between DPE and EP that static stream config with pre-declared streams would be maintained.
User Stories
As an engineer
I want to ensure that instruments' configuration is fetched from xLab and integrated in the events producing process as a separate layer on top of stream configuration in order to produce accurate events from instruments managed by xLab
So that …
As a product analyst and a product owner
I want to see expected events on the backend according to how an instrument is configured in xLab
So that …
Description
Present
Currently, we deliver the configuration for the Metrics Platform client inside of stream configuration – sampling unit and sample size, and contextual attributes are configured on a per-stream basis. Therefore, there is a one to one relatonship between streams and instruments. However, this is misaligned with the relationship that we present through xLab. In xLab, an instrument owner can create many instruments that share the same stream, i.e. one stream can have many instruments.
| In code | In xLab |
|---|---|
Proposal
In essence, we should provide instrument configuration as a layer on top of stream configuration rather than trying to create merge rules for streams that are defined statically and updated by instrument configuration forms in xLab. This layering will allow us to:
- Distinguish between the Event Platform and the Experiment Platform
- Keep stream configs static, which DPE would prefer
- Be backwards compatible with all existing uses of the Event Platform/Metrics Platform for instrumentation easily
We will implement this as follows:
- Update the Metrics Platform clients to accept both stream configs (for backwards compatibility) and instrument configs
- [MetricsPlatform] Fetch instrument configs from xLab
- [MetricsPlatform] Initialize a new Metrics Platform client with the instrument configs from (2)
- [MetricsPlatform] Create a new API to allow instrument owners to use instruments managed with xLab, e.g. mw.xLab.getInstrument()

