==== Background
See the parent task ({T292803}) 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"`
**** `"expand"`
**** `"collapse"`
*** `event_context (string)`
**** `"page"`
**** `"accordion"`
**** `"popup"`
*** `event_source (string)`
**** `"action_history"`
**** `"special_log"`
**** `"special_recentchanges"`
*** `user_editBucket (string|null)`
*** `user_groups (string[])`
[] A basic JavaScript logger function should be defined in the IP Info codebase
[] The logger function should be enabled by a configuration variable, which is falsy by default
[] 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", ... ]
}
```
[] When I expand the infobox, the following event should be logged:
```
{
"$schema": "analytics.mediawiki.ipinfo_interaction/1.0.0",
event_action: "expand",
event_context: "accordion",
user_editBucket: "...",
user_groups: [ "users", ... ]
}
```
[] When I collapse the infobox, the following event should be logged:
```
{
"$schema": "analytics.mediawiki.ipinfo_interaction/1.0.0",
event_action: "collapse",
event_context: "accordion",
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`
1. 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
1. [[ https://wikitech.wikimedia.org/wiki/Event_Platform/Instrumentation_How_To | wt:Event Platform/Instrumentation How To ]] is a step-by-step guide to creating a creating a schema and validating an event with it
1. https://www.mediawiki.org/wiki/MediaWiki-Docker/Configuration_recipes/EventLogging is a step-by-step guide to setting up your local development environment