Page MenuHomePhabricator

EditAttemptStep Migration to MP
Open, Needs TriagePublic

Description

Goal: Migrate Edit Attempt Step Schema to the Metrics Platform.
Tasks
  • Configured a stream using the Metrics Platform Client to duplicate the data captured by the current EditAttemptStep Schema
  • Have the MP the data its collecting to a hive table.
  • Have Product Analytics validate the data is being collected correctly
 Notes
  1. The instruments in the DiscussionTools and MobileFrontend extensions are very similar and we should be able to migrate them in precisely the same way

Event Timeline

EChetty updated the task description. (Show Details)
EChetty updated the task description. (Show Details)
EChetty renamed this task from Edit Attempt Step Migration to EditAttemptStep Migration to MP.May 24 2022, 12:31 PM
EChetty moved this task from Work in Progress to QA/Review on the Metrics-Platform board.

Here's the example stream configuration that I landed on while working through the migration:

LocalSettings.php
$wgEventLoggingStreamNames = [
  'edit_attempt_step',
];

// At the time of writing, per [0], $wgDTEditAttemptStepOversample is always true and so $wgDTEditAttemptStepSampleRate is always 1.
//
// FIXME: Should wgDTEditAttemptStepSampleRate and $wgDTEditAttemptStepOversample be removed?
//
// [0] https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/d9079d6cb153d5b24e602842861cb5a93908773b/wmf-config/InitialiseSettings.php#20404

// Per https://gerrit.wikimedia.org/g/mediawiki/extensions/DiscussionTools/+/c8dac438be02dffa8832c151aa55b1e1590b561d/modules/logger.js#33
$wgDTEditAttemptStepSampleRate = $wgDTSchemaEditAttemptStepSamplingRate || $wgWMESchemaEditAttemptStepSamplingRate;

// Per https://gerrit.wikimedia.org/g/mediawiki/extensions/DiscussionTools/+/c8dac438be02dffa8832c151aa55b1e1590b561d/modules/logger.js#174
if ( $wgDTSchemaEditAttemptStepOversample || $wgWMESchemaEditAttemptStepOversample ) {
  $wgDTEditAttemptStepSampleRate = 1;
}

$wgEventStreams = [
  [
    'stream' => 'edit_attempt_step',
    'schema_title' => '/analytics/mediawiki/client/metrics_event',
    'destination_event_service' => 'eventgate-analytics-external',
    'sample' => [
      'unit' => 'pageview',
      'rate' => $wgDTEditAttemptStepSampleRate,
    ],
    'producers' => [
      'metrics_platform_client' => [
        'events' => [ 'eas.' ],
        'provide_values' => [
          'page_id',
          'page_revision_id',
          'page_title',
          'page_namespace',
          'performer_id',
          'performer_is_logged_in',
          'performer_edit_count',
          'mediawiki_version',
          'agent_client_platform_family',
          'performer_pageview_id',
          'performer_session_id',
        ],
      ],
    ],
  ],
];

Change 798830 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/DiscussionTools@master] logger: Also log EditAttemptStep events via Metrics Platform

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

ppelberg moved this task from Backlog to Triaged on the DiscussionTools board.
ppelberg added a subscriber: phuedx.

Notes on the EAS instrument's (down)sampling rates:

DiscussionTools
  • Default: 6.25% of all pageviews
  • Currently: 100% of all pageviews ($wgDTEditAttemptStepOversample is truthy on all wikis)
  • Can also be set to 100% of all pageviews by third-party extensions
    • GrowthExperiments does this when the user clicks a suggested edit card on their newcomer homepage.
MobileFrontend
  • 6.25% of all pageviews
  • Can also be set to 100% of all pageviews by third-party extensions
    • GrowthExperiments does this when the user clicks a suggested edit card on their newcomer homepage
  • Can also be when the user is using a certain wikitext editor
    • On some wikis this is the case for all wikitext editors
VisualEditor & WikiEditor
  • 6.25% of all editing sessions
  • Can also be set to 100% of all pageviews by third-party extensions
    • GrowthExperiments does this when the user clicks a suggested edit card on their newcomer homepage
  • The editing session ID can be overridden by third-party extensions

Change 803327 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/MobileFrontend@master] schemaEditAttemptStep: Also log EditAttemptStep events via Metrics Platform

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

Change 803889 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/VisualEditor@master] Also log EditAttemptStep events via Metrics Platform

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

Hey, @DLynch/Editing! The Metrics Platform team (read: @EChetty and myself) would like to move forward with getting data from the Metrics Platform implementations of the EAS instrument. We think that T310693: Make Metrics Platform Clients record sampling rate and unit in the event and T311629: Change agent_client_platform_family context attribute values should be worked on but shouldn't block the review of the patches that have been submitted. Would it be possible to schedule these reviews?

Change 798830 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] logger: Also log EditAttemptStep events via Metrics Platform

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

Change 803889 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Also log EditAttemptStep events via Metrics Platform

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

Change 803327 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] schemaEditAttemptStep: Also log EditAttemptStep events via Metrics Platform

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