Description
The *UIActions instrument is a good case study for us (Data Products) as it logs custom data (i.e. instrument- or domain-specific data) that would have to be schemaed and we're going to need a documented process for this as we onboard other teams. However, the Web team, who own the instrument, are currently updating it in order to establish baseline metrics prior to releasing a new feature.
In order to minimise risk for the Web team, let's do a parallel implementation of the logging part of the instrument that uses the Core Interaction API.
User Story/ies
As a developer, I want/need 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
As noted in the description, the instrument logs custom data. These data are:
- skinVersion – @Jdlrobson: Is this needed?
- isSidebarCollapsed
- viewportSizeBucket
- font
- is_full_width
- is_page_preview_on
- is_pinned
- is_media_viewer_enabled
- is_dark_mode_prepared_by_os
- is_dark_mode_on
Fortunately, these data are already schemaed by the fragment/analytics/web_accessibility/1.0.0 schema fragment. Thus, our first step will be to create a concrete schema for the new event stream that extends (?) analytics/product_metrics/web/base/1.0.0 and mixes in that fragment.
Next, we would need to update WikimediaEvents/modules/ext.wikimediaEvents/desktopWebUIActions.js and WikimediaEvents/modules/ext.wikimediaEvents/mobileWebUIActions.js as follows:
mw.eventLog.logEvent( 'DesktopWebUIActionsTracking', webA11ySettingsData ); // => delete webA11ySettingsData.action; // … and delete all data that can be mixed in by the JS Metrics Platform client library. mw.eventLog.submitInteraction( 'mediawiki.web_ui_actions.migrated', '/analytics/product_metrics/web/ui_actions/1.0.0', action, webA11ySettingsData );
Finally, we'd need to define the corresponding stream in operations/mediawiki-config/wmf-config/ext-EventStreamConfig.php as follows:
'mediawiki.web_ui_scroll' => [ 'schema_title' => 'analytics/product_metrics/web/web_base', 'destination_event_service' => 'eventgate-analytics-external', 'producers' => [ 'metrics_platform_client' => [ // See also https://github.com/wikimedia/operations-mediawiki-config/blob/6e1ea777ed3b4e4ec151a4ea9d318cfc0c999784/wmf-config/ext-EventStreamConfig.php#L980 'provide_values' => [ 'page_namespace', 'performer_is_logged_in', 'performer_session_id', 'performer_pageview_id', 'performer_edit_count_bucket', 'mediawiki_skin', 'mediawiki_database' ], 'curation' => [ 'mediawiki_skin' => [ 'in' => [ 'minerva', 'vector', 'vector-2022' ], ], ], ], 'sample' => [ 'unit' => 'pageview', 'rate' => …, ], ],
Dependencies
N/A
Artifacts & Resources
N/A