Background
The Safety and Security team created a custom schema to capture hCaptcha risk scores for various activities and have submitted a patch to introduce a new stream that uses the schema. Currently, they can't create an instrument in Test Kitchen UI and/or use the Test Kitchen PHP SDK to implement the instrument because the PHP SDK is lagging behind the JS SDK slightly. Concretely, the PHP SDK needs the equivalent of mw.xLab.getInstrument().
Suggested API
/** @var \MediaWiki\Extension\MetricsPlatform\XLab\InstrumentManager $instrumentManager */ $instrumentManager = $services->getService( 'MetricsPlatform.XLab.InsturmentManager' ) ->getInstrument( 'my-awesome-instrument' );
namespace MediaWiki\Extension\MetricsPlatform\XLab; interface InstrumentManager { public function getInstrument( string $instrumentName ): Instrument; } interface Instrument { public function send( string $action, array $interactionData = [] ): void; }