Page MenuHomePhabricator

Basic ipinfo instrument setup and first events
Closed, ResolvedPublic8 Estimated Story Points

Description

Background

See the parent task (T292803: IP Info: Explore Instrumentation) for detail about both why we're instrumenting IP Info and what we intend to instrument.

Before we can send events via EventLogging and have them ingested by the EventGate event intake servers, however, we need to:

  1. Create the JSON Schema schema used to validate the events that our instrument sends and add it to the https://gerrit.wikimedia.org/r/admin/repos/schemas/event/secondary repository
  2. Update the MediaWiki extension's definition to include a stream name that we will publish our events on that will be validated by that schema
  3. Profit
AC
  • The analytics.mediawiki.ipinfo_interaction JSON Schema is defined in the https://gerrit.wikimedia.org/r/admin/repos/schemas/event/secondary repository
    • By convention, it'll live in jsonschema/analytics/mediawiki/ipinfo_interaction
    • It will have the following fields defined:
      • event_action (string)
        • "open_popup"
        • "open_infobox"
        • "expand"
        • "collapse"
        • "init_disclaimer"
        • "accept_disclaimer"
        • "close_disclaimer"
        • "enable_ipinfo"
        • "disable_ipinfo"
        • "check_iagree"
        • "uncheck_iagree"
        • "copy"
        • "click_help"
      • event_context (string)
        • "page"
        • "infobox"
        • "popup"
        • "ip_address"
      • event_source (string)
        • "action_history"
        • "special_log"
        • "special_recentchanges"
        • "special_contributions"
        • "special_preferences"
      • user_editBucket (string|null)"
        • "0 edits"
        • "1-4 edits"
        • "5-99 edits"
        • "100-999 edits"
        • "1000+ edits"
      • user_groups (string|null)
        • A "|"-separated list of the groups that the user belongs to
  • When I click the ? button next to an IP address, the following event should be logged:
{
  "$schema": "analytics.mediawiki.ipinfo_interaction/1.0.0",
  event_action: "open_popup",
  event_context: "page",
  event_source: "...", // Depending on the action/page that I'm on, i.e. one of "action_history", "special_log", "special_recentchanges"
  user_editBucket: "...",
  user_groups: [ "users", ... ]
}
Notes
  1. mw.config.get( 'wgUserEditCountBucket' );, which is set by the EventLogging extension, should be used to populate user_editBucket
  2. See the current.yaml files in the subdirectories in https://gerrit.wikimedia.org/r/plugins/gitiles/schemas/event/secondary/+/refs/heads/master/jsonschema/analytics/mediawiki for numerous examples of JSON Schema schemas that are used in production
  3. wt:Event Platform/Instrumentation How To is a step-by-step guide to creating a creating a schema and validating an event with it
  4. https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/EventLogging is a step-by-step guide to setting up your local development environment

Event Timeline

phuedx updated the task description. (Show Details)
ARamirez_WMF renamed this task from Basic ipinfo instrument setup and first events to Basic ipinfo instrument setup and first events [L].Nov 30 2021, 5:24 PM

Change 753548 had a related patch set uploaded (by AGueyte; author: AGueyte):

[schemas/event/secondary@master] WIP: Basic ipinfo instrument setup

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

@phuedx Is deployment (i.e. updating mediawiki-config and EventLogging) meant to be encapsulated in this task too, or is there a separate task for that?

@phuedx Is deployment (i.e. updating mediawiki-config and EventLogging) meant to be encapsulated in this task too, or is there a separate task for that?

Enabling the instrument in production (updating mediawiki-config) should be a separate task. AFAICT we shouldn't have to touch the EventLogging extension. Also, when @AGueyte's patch is merged, the schema will be published for clients to use automatically.

Change 756634 had a related patch set uploaded (by AGueyte; author: AGueyte):

[mediawiki/extensions/IPInfo@master] Add first click event

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

Change 756635 had a related patch set uploaded (by AGueyte; author: AGueyte):

[operations/mediawiki-config@master] Update Event Stream

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

Tchanders renamed this task from Basic ipinfo instrument setup and first events [L] to Basic ipinfo instrument setup and first events [XL].Jan 24 2022, 6:27 PM
ARamirez_WMF renamed this task from Basic ipinfo instrument setup and first events [XL] to Basic ipinfo instrument setup and first events.Feb 8 2022, 4:59 PM
ARamirez_WMF set the point value for this task to 8.

Change 753548 merged by jenkins-bot:

[schemas/event/secondary@master] Basic ipinfo instrument setup

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

Change 756635 merged by jenkins-bot:

[operations/mediawiki-config@master] Update Event Stream for IPInfo events

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

Change 756634 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Add IPInfo click logging event

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

Change 767558 had a related patch set uploaded (by Tchanders; author: Tchanders):

[operations/mediawiki-config@master] Define IPInfo event stream on Beta

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

Change 767558 merged by jenkins-bot:

[operations/mediawiki-config@master] Define IPInfo event stream on Beta

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

Event action now loading, see screen shot below:

Screen Shot 2022-03-17 at 11.20.16 AM.png (1×2 px, 685 KB)