Page MenuHomePhabricator

Deprecate use of desktop- and mobilewebuiactions in Event Platform
Closed, ResolvedPublic2 Estimated Story Points

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.

Requirement

Deprecate the use of desktopwebuiactions and mobilewebuiactions schemas in the Event Platform, transitioning to web_ui_actions in the Metrics Platform. This will reduce technical debt and ensure unified logging of UI actions without user-facing changes.

BDD

Feature: Deprecate desktopwebuiactions and mobilewebuiactions schemas in Event Platform

  Scenario: Use web_ui_actions exclusively in Metrics Platform
    Given UI actions are logged
    When UI interactions occur on desktop or mobile
    Then actions should be logged under `web_ui_actions`
    And the `desktopwebuiactions` and `mobilewebuiactions` schemas should no longer be used

Test Steps

Test Case 1: Verify Transition to web_ui_actions Schema

  1. Trigger various UI actions on desktop and mobile platforms.
  2. AC1: Confirm actions are logged under the web_ui_actions schema.
  3. AC2: Confirm the desktopwebuiactions and mobilewebuiactions schemas are no longer in use.

Design

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

Acceptance criteria

• 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.

https://phabricator.wikimedia.org/T368678#10239929
https://phabricator.wikimedia.org/T368678#10243169

QA Results - Prod


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

Details

Other Assignee
KSarabia-WMF

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.Jul 3 2024, 7:53 PM
Jdlrobson moved this task from Incoming to Groomed on the Web-Team-Backlog-Archived board.

@jwang and I discussed this and we have permission to go ahead with this.

I will update this to just be about deleting the event in WikimediaEvents, and make a new ticket for the deprecation process.

For deletion: 2 points
For deprecation: 2 points

Edtadros subscribed.

Test Result - Beta

Status: ❓Need More Info / ❌ FAIL
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Transition to web_ui_actions Schema

  1. Trigger various UI actions on desktop and mobile platforms.
  2. AC1: Confirm actions are logged under the web_ui_actions schema.
DesktopMinerva
screenshot 69.png (1×1 px, 467 KB)
I was unable to get any events other than the ones here.
screenshot 73.png (1×1 px, 316 KB)
screenshot 72.png (1×1 px, 316 KB)
screenshot 71.png (1×1 px, 319 KB)
screenshot 70.png (1×1 px, 319 KB)
  1. AC2: Confirm the desktopwebuiactions and mobilewebuiactions schemas are no longer in use.

This works for desktop, but I wasn't able to verify mobile.

Quick Update:
The patch to remove desktopWebUIActions was reverted in Gitlab because the event stream was still active, causing issues in Canary.

Now we need confirmation: should we keep the revert, or proceed with removing the schema once the event stream is turned off, or a third option? (@Ottomata If you could chime in on what we need to do, that would be appreciated.) One of these needs to be done and documented after the EventStream Removal Patch is merged.

Hi, the decommissioning process isn't great. But, I just updated some documentation:

https://wikitech.wikimedia.org/wiki/Event_Platform/Instrumentation_How_To#Decommissioning

It is better to leave the schema in place and mark that it is deprecated.

@Edtadros Sorry for the missing QA steps.
Unless you have a way of being sampled into the event tracking manually, I think you were sampled out so that is why you didn't see anything.
Events are still firing 100% for all users in testwiki, and I was able to see the events there.

Screenshot 2024-10-15 at 6.55.17 PM.png (2×2 px, 611 KB)

@SToyofuku-WMF

For QA, you can use a query like below

SELECT *
FROM event.DesktopWebUIActionsTracking
WHERE wiki = 'enwiki'
AND SUBSTRING(dt, 1, 10) = '2024-10-17'
ORDER BY dt DESC
LIMIT 5;

and observe the number of events has dwindled to 0

Ran

SELECT day, count(*)
FROM event.DesktopWebUIActionsTracking
WHERE year = 2024 and month = 10
group by 1 order by 1 asc

and can confirm the 15th is the last day we have events!

Test Result - Prod

Status: ✅ PASS
Environment: testwiki, enwiki
OS: macOS
Browser: Chrome
Device: MS MBA
Emulated Device: NA

Test Artifact(s):

Test Case 1: Verify Transition to web_ui_actions Schema

  1. Trigger various UI actions on desktop and mobile platforms.
  2. AC1: Confirm actions are logged under the web_ui_actions schema.
  3. AC2: Confirm the desktopwebuiactions and mobilewebuiactions schemas are no longer in use.

During the testing T349862#10240396 I only saw the web_ui_actions schema, so while redundant to the more comprehensive validation in T368678#10239929 above, I can also confirm that this is a pass.