Page MenuHomePhabricator

Deprecate use of desktop- and mobilewebuiactions in Event Platform
Open, MediumPublic

Description

Background

We have been transitioning from using desktopwebuiactions and mobilwwebuiactions in the Event Platform to web_ui_actions in the Metrics Platform to align with our strategy of using MP as the future platform. Stopping use of desktop- and mobilewebuiactions will reduce technical debt and streamline our instrumentation, ensuring consistent and efficient data collection. This transition should not directly affect the end user and any current deliverables but will improve the overall performance and maintainability of our systems.

User story

As an engineer, I want to retire desktopwebuiactions and mobilwwebuiactions and only use web_ui_actions in the Metrics Platform so that we can reduce technical debt and maintain a single source of instrumentation for UI actions.

Requirements

  • Deprecate desktopwebuiactions and mobilewebuiactions in the Event Platform.
  • Migrate all existing events from desktopwebuiactions to web_ui_actions in the Metrics Platform.
  • Ensure Web team metrics-related documentation is updated to reflect this change.
  • Communicate the change to relevant stakeholders, including everyone in Web team, Data-Engineering Slack, Editing team, and look into any other teams have used this instrument in the past
  • Ensure that the sampling for this instrument is per session not per-pageview.
  • Ensure that queries in all ongoing reporting (e.g. any monitoring dashboards, recurring reports) use the new data

BDD

  • For QA engineer to fill out

Test Steps

  • For QA engineer to fill out

Design

  • No mockups required for this change as it is backend-related.

Acceptance criteria

• Ensure the old schema desktopwebuiactions is deprecated and no longer fires.
• To be safe, verify again that all events are now using the web_ui_actions schema in the Metrics Platform.
• Update all relevant documentation to reflect the deprecation of desktopwebuiactions .
• After this is done, make a ticket to monitor logstash to ensure the new setup is functioning as expected.

Communication criteria

  • An announcement should be made to the Web team about the deprecation of desktopwebuiactions and mobilewebuiactions and the transition to web_ui_actions.
  • Discussion should be initiated in the relevant project meetings to ensure everyone is aware of the change.

Rollback plan

  • If any issues arise during the transition, revert the events back to using desktopwebuiactions.

This task was created by Version 1.0.0 of the Web team task template using phabulous

Event Timeline

Ensure that the sampling for this instrument is per session not per-pageview.

mediawiki.web_ui_actions uses

'sample' => [
  'unit' => 'session',
  'rate' => 0.2,
],

Source: https://noc.wikimedia.org/conf/highlight.php?file=ext-EventStreamConfig.php

Yanking the sampling logic out of the instrument should suffice (in theory).

@mpopov Does removing the sampling logic leave the configuration without a default? Or is there another place where the default should be set?

@KSarabia-WMF: The default is in the stream config (pasted above) and it's currently set to 20% of sessions on all projects. And what's happening with the migrated instrumentation is that it's being double-sampled – the instrument initializes on 20% of pageviews (1% on English projects) and when it produces events to the mediawiki.web_ui_actions stream, only 20% of sessions will actually submit an event.

According to https://wikitech.wikimedia.org/wiki/Metrics_Platform/How_to/Creating_a_Stream_Configuration#Example_1 you would probably want to add something like

'+enwiki' => [
        'mediawiki.web_ui_actions' => [
            'sample' => [
                'rate' => 0.01,
                'unit' => 'session',
            ],
        ],
    ],

so that we're only collecting data from 1% of sessions on English Wikipedia. Volume of data is not a problem right now because of the double-sampling but we would want to add this.

@cjming: Can you please confirm? (That this is how we would set an enwiki-specific sampling rate.) Also! would '+en' work? The docs mention specifying deployment groups but I don't know if language groups are supported.

Confirming that overrides per wiki should be added to config the way @mpopov has described.

Fwiw, there's already an override for enwiki and mediawiki.web_ui_actions in prod config.

I'm a little confused tho -- there's mediawiki.web_ui_actions which is not using MP schemas and there's mediawiki.web_ui_scroll_migrated which is using MP's web base schema. If the data QA parity checks between the two have been done and verified, one of these should probably go away.

@KSarabia-WMF overriding either is the same mechanism as Mikhail noted above but maybe mediawiki.web_ui_actions should be retired in favor of mediawiki.web_ui_actions_migrated if the goal is to have a single table for UI actions that uses MP?

One thing I might suggest after all this is work is wrapped up is to clean up the corresponding Hive tables after the older stream configs have been removed as a follow up ticket (they don't get automatically deleted when stream configs are removed afaik).

would '+en' work? The docs mention specifying deployment groups but I don't know if language groups are supported.

@mpopov '+en' will not work - dblist is hardcoded - all language codes have wiki appended and deployment groups are for train rollouts i.e. group2 which is where enwiki is included.

I believe mediawiki.web_ui_actions succeeds eventlogging_DesktopWebUIActionsTrackingand eventlogging_MobileWebUIActionsTracking
and mediawiki.web_ui_scroll_migrated succeeds mediawiki.web_ui_scroll

@cjming: Thank you so much for verifying/clarifying!

So no further action is needed except, like I mentioned earlier, removing the sampling logic from the instrument.

oh whoops! you're right @mpopov --- i should read more carefully -- @KSarabia-WMF please disregard my earlier message - somehow i conflated the two.

FYI to folks, just to be super careful, we probably won't deploy this until after the data collection for T367871 is done.

Jdlrobson triaged this task as Medium priority.Wed, Jul 3, 7:53 PM
Jdlrobson moved this task from Incoming to Groomed on the Web-Team-Backlog board.