Description
The SpecialDiff instrument was added in T326214: Log additional click events on Special:Diff. It submits events representing clicks to UI elements on the Special:Diff/Special:MobileDiff pages. It uses mw.eventLog.dispatch() (it already uses the Metrics Platform!), which is now deprecated. It should be migrated to use mw.eventLog.submitInteractionEvent() or .submitClick().
User Story/ies
As a developer
I want to understand the process of migrating my instrument to the Metrics Platform
So I can migrate my remaining instruments without intervention
Outcome
- The new instrument is publishing events to distinct stream in parallel with the original
Required
- Unit tests
- Integration tests
- Testing Instructions
- Passed QA
- Documentation
Technical Notes
In terms of the data that is collected, the instrument is trivial. It submits an event name, which encodes the source of the click, along with some contextual data. As with other instruments that use the Metrics Platform, the contextual data is controlled by stream config. The stream associated with the instrument is mediawiki.special_diff_interactions (see: https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/74354a8b6deb116163edc42b326fade78ced094a/wmf-config/ext-EventStreamConfig.php#1057).
As I said, the event name encodes the source of the click so migrating the instrument should be as simple as replacing:
mw.eventLog.dispatch( `specialDiff.click.${eventName}` );
with:
mw.eventLog.submitClick( // TODO: Bikeshed this! It's very difficult to change the name of the stream so pick a good one! 'mediawiki.special_diff_interactions.migrated', { action_source: eventName } );
Creating the new stream should be as simple as:
- Duplicating the existing stream config
- Updating the name of the new stream config to the stream name you chose above
- Replacing its schema_title property with /analytics/product_metrics/web/base
- Deleting its producers.metrics_platform_client.events property
💪
Dependencies
N/A
Artifacts & Resources
- The instrument is defined in the following files:
- https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaEvents/+/4f18f44e3cbafb448817297799832b3441ed1d4b/modules/ext.wikimediaEvents.specialPages/specialDiff.js
- https://gerrit.wikimedia.org/g/mediawiki/extensions/WikimediaEvents/+/4f18f44e3cbafb448817297799832b3441ed1d4b/modules/ext.wikimediaEvents.specialPages/specialMobileDiff.js