Page MenuHomePhabricator

Migrate all instruments using mw.eventLog.newInstrument to mw.testKitchen.getInstrument()
Open, HighPublic3 Estimated Story Points

Description

Description

Before {T408097: Remove mw.eventLog.newInstrument()} we should migrate all instruments that are using mw.eventLog.newInstrument so they use mw.testKitchen.getInstrument instead

Acceptance criteria

Event Timeline

JVanderhoop-WMF moved this task from Tidy up EventLogging to Backlog on the Test Kitchen board.
JVanderhoop-WMF set the point value for this task to 3.

Change #1269657 had a related patch set uploaded (by Kareid; author: Kareid):

[mediawiki/extensions/WikimediaEvents@master] ext.wikimediaEvents: Migrate CreateAccount instrument to getInstrument

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

@KReid-WMF @Sfaci: I was inspecting events landing in the web base stream/topic and came across

{
  "http": {
    "request_headers": {
      "user-agent": "<REDACTED>"
    }
  },
  "meta": {
    "domain": "auth.wikimedia.org",
    "stream": "product_metrics.web_base",
    "id": "<REDACTED>",
    "dt": "2026-04-13T15:01:15.430Z",
    "request_id": "<REDACTED>"
  },
  "dt": "2026-04-13T15:01:15Z",
  "action": "email_invalidated",
  "$schema": "/analytics/product_metrics/web/base/1.3.0",
  "agent": {
    "client_platform": "mediawiki_php",
    "client_platform_family": "mobile_browser"
  },
  "performer": {
    "is_logged_in": false,
    "is_temp": false
  },
  "mediawiki": {
    "skin": "minerva",
    "database": "enwiki"
  }
}

That might be from the account creation instrumentation? The JS part was recently migrated[1] but it looks like the PHP part hasn't[2]

[1] https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/1269657
[2] https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaEvents/+/dff224699a45a3b97919a8a290237cef4806e58c/includes/WikimediaEventsHooks.php#671

When we migrate the PHP instrumentation we should also make sure that the PHP SDK is up to date with the JS SDK and sets instrument_name.

. . .
. . .

That might be from the account creation instrumentation? The JS part was recently migrated[1] but it looks like the PHP part hasn't[2]

[1] https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaEvents/+/1269657
[2] https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaEvents/+/dff224699a45a3b97919a8a290237cef4806e58c/includes/WikimediaEventsHooks.php#671

When we migrate the PHP instrumentation we should also make sure that the PHP SDK is up to date with the JS SDK and sets instrument_name.

The JS part [1] is still an active patch so the older JS instrument is still working as before along with its PHP part, untouched as well.

Anyway, I would like to hear more about why JS and PHP parts should be migrated at the same time (is it because the instrument_name thing? I didn't see anything wrong in the sample event you have attached above). At this time we are not working according that way so, if relevant, we should re-align the way we are addressing these migrations. So far, everything is organized based on the specific piece of code we want to deprecated/migrate because, in theory, we are not altering the way the instrument is working. We are just refactoring.

If this is about the instrument_name field, I guess that the refactoring might have that collateral effect because now both JS and PHP SDKs are setting that attribute automatically and this wasn't being done before (I would say some instruments could be doing it explicitly though, like this case)

Change #1269657 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] ext.wikimediaEvents: Migrate CreateAccount instrument to getInstrument

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

Change #1287937 had a related patch set uploaded (by Kareid; author: Kareid):

[mediawiki/extensions/GrowthExperiments@master] ext.GrowthExperiments: Migrate homepage instrument to getInstrument()

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

Change #1289318 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] cleanup: remove ext.growthExperiments.Logging

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

Change #1289318 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] cleanup: remove ext.growthExperiments.Logging

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

Change #1287937 abandoned by Kareid:

[mediawiki/extensions/GrowthExperiments@master] ext.GrowthExperiments: Migrate homepage instrument to getInstrument()

Reason:

1289318 makes this change unnecessary.

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

Change #1294329 had a related patch set uploaded (by Kareid; author: Kareid):

[mediawiki/extensions/CheckUser@master] ext.CheckUser: Migrate three instruments to getInstrument

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

Change #1295469 had a related patch set uploaded (by Kareid; author: Kareid):

[integration/config@master] zuul: [mediawiki/extensions/CheckUser] Add TestKitchen dependency

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

Change #1296677 had a related patch set uploaded (by Kareid; author: Kareid):

[mediawiki/extensions/ReportIncident@master] ext.ReportIncident: Migrate instrument to getInstrument

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

Change #1295469 merged by jenkins-bot:

[integration/config@master] zuul: [mediawiki/extensions/CheckUser] Add TestKitchen dependency

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

Change #1296677 merged by jenkins-bot:

[mediawiki/extensions/ReportIncident@master] ext.ReportIncident: Migrate instrument to getInstrument

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

Change #1294329 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] ext.CheckUser: Migrate three instruments to getInstrument

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