Page MenuHomePhabricator

TestKitchen Extension: Merge PHP MetricsPlatform client library
Open, Needs TriagePublic

Description

Ronseal

Currently, the EventLogging MediaWiki extension (EventLogging) is responsible for delivering the JS and PHP Metrics Platform Client Libraries. This decision was made some time ago to expedite initial deployment of those libraries.

Now, Experiment Platform will be deploying the TestKitchen MediaWiki extension (TestKitchen) as part of the Test Kitchen project. We should merge the libraries with the Test Kitchen SDKs as:

  • It puts everything related to MediaWiki and Test Kitchen in one place
  • It de-bloats the EventLogging extension, which is also responsible for delivering the Event Platform client and contains a lot of legacy code
  • It clarifies that Test Kitchen supersedes Metrics Platform

AC

  • The PHP Metrics Platform Client Library is merged into the TestKitchen extension
  • Existing instruments are migrated to use the Test Kitchen SDKs

Requirements

  • QA passed?
  • Documentation

Event Timeline

Questions from @Milimetric during grooming:

What is left in eventlogging after this move?
@phuedx are you thinking about this work towards decommissioning or a bigger plan for eventlogging?

Event platform is a way to publish events to a stream agnostically, open question about whether or not this creates a duplication of effort between MP and EP. Let's discuss!

CC @Ottomata

Event platform is a way to publish events to a stream agnostically, open question about whether or not this creates a duplication of effort between MP and EP. Let's discuss!

EventLogging, MetricsPlatform and EventBus are all (more or less) 'opinionated' Event Platform clients.

I started writing a whole comment about how it could be nice to have a shared composer-required PHP EventGate producer library, but on second thought I'm not sure how useful that would be. The EventGate HTTP API is pretty simple.

A shared PHP library that tied together EventStreamConfig and EventGate producing could be nice. We could use the same config 'EventGate client' instance for EventBus and EventLogging and MetricsPlatform then.

But, that might be out of scope of this project ;)

For JS, I don't think we have many use cases other than MW analytics. I'm not sure if a shared JS eventgate producer library would be that helpful.


See also: https://wikitech.wikimedia.org/wiki/Event_Platform/Producer_Requirements
(When using EventGate, many of those requirements are handled by EventGate)

FWIW, I think Data Products should own the EventLogging extension and do whatever they think is best.

The trickiest part about making big changes to it could be '3rd party' support, which I've heard is a thing, but don't know anything about.

FWIW, I think Data Products should own the EventLogging extension and do whatever they think is best.

Interesting… /cc @WDoranWMF

The trickiest part about making big changes to it could be '3rd party' support, which I've heard is a thing, but don't know anything about.

For sure. FWIW MediaWiki extensions aren't in scope for the Stable Interface Policy BUT we tend to follow it for EventLogging. It might be worth formally deciding whether or not to and announcing it 🤔 Unfortunately, Pingback doesn't include extensions and WikiApiary appears to be down so it's difficult for us to determine how many third-parties are using EventLogging.

What is left in eventlogging after this move?

  1. [PHP] Pre-draft-03 JSONSchema validation code (see T317793: [EPIC] Deprecate EventLogging::schemaValidate())
  2. [JS] The mw.eventLog.Schema class, which overlaps with Metrics Platform a little and has been around for _a long time_ (see T305491: Deprecate/delete the mw.eventLog.Schema class)
  3. [JS] The mw.eventLog.logEvent() method (see T317874: [EPIC] Deprecate mw.eventLog.logEvent())
  4. [PHP] The EventLogging::logEvent() method (see T318263: [EPIC] Deprecate EventLogging::logEvent())
  5. [PHP] The EventLogging::submit() method, which we should keep!

@phuedx are you thinking about this work towards decommissioning or a bigger plan for eventlogging?

I would like to see 1 through 4 Done™.

I have have a feeling that Timo will have objections about 1.-4. These are ones possibly used by 3rd parties?

phuedx renamed this task from Make MetricsPlatform MediaWiki extension deliver JS and PHP Client Libraries to MetricsPlatform: Deliver JS and PHP Client Libraries.Jun 22 2024, 7:20 AM

Non-blocking technical debt, tidy up part of EventLogging. Moving to backlog.

Milimetric renamed this task from MetricsPlatform: Deliver JS and PHP Client Libraries to MetricsPlatform Extension: Migrate JS and PHP Client Libraries.Nov 12 2024, 3:56 PM
Milimetric triaged this task as Medium priority.
Milimetric added a project: Technical-Debt.
Sfaci raised the priority of this task from Medium to Needs Triage.Nov 4 2025, 8:45 AM
Sfaci moved this task from Incoming to Tidy up EventLogging on the Test Kitchen board.
phuedx renamed this task from MetricsPlatform Extension: Migrate JS and PHP Client Libraries to Test Kitchen Extension: Merge PHP MetricsPlatform client library.Fri, Jan 16, 11:07 AM
phuedx renamed this task from Test Kitchen Extension: Merge PHP MetricsPlatform client library to TestKitchen Extension: Merge PHP MetricsPlatform client library.
phuedx updated the task description. (Show Details)

Change #1227747 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/TestKitchen@master] PHP SDK: Merge Wikimedia\MetricsPlatform library

https://gerrit.wikimedia.org/r/1227747