Until MPIC or the experimentation platform becomes the canonical source of instrument documentation, create a public, on-wiki process for documenting instruments. This will be a lightweight, flexible process intended to be an interim solution.
See also:
- https://wikitech.wikimedia.org/wiki/Metrics_Platform/Deployed_Streams
## Notes### Use cases for instrument documentation
Based on searching for `metrics_platform_client` in https://gerrit.wikimedia.org/r/plugins/gitiles/operations/mediawiki-config/+/refs/heads/master/wmf-config/ext-EventStreamConfig.php- As someone interested in the Metrics Platform, there are 12 active events streams using Metrics Platform:
- android.product_metrics.article_link_preview_interaction
- schema: analytics/product_metrics/app/base (https://schema.wikimedia.org/repositories//secondary/jsonschema/analytics/product_metrics/app/base/latest)
- android.product_metrics.article_toc_interaction
- schema: analytics/mobile_apps/product_metrics/android_article_toc_interaction
- android.product_metrics.article_toolbar_interaction
- schema: analytics/product_metrics/app/base
- android.product_metrics.find_in_page_interaction
- schema: analytics/mobile_apps/product_metrics/android_find_in_page_interactionlearn what instruments are currently active
- mediawiki.web_ui_actions
- location: WikimediaEvents
- https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikimediaEvents/+/refs/heads/master/OWNERS.md#click_tracking-for-vector-and-minerva
- schema: analytics/mediawiki/product_metrics/web_ui_action- As someone interested in WMF data collection, learn about what data is being collected by Metrics Platform instruments
- mediawiki.web_ui_scroll_migrated- As someone doing data analysis using Metrics Platform instrument data, find information about the data collected by an instrument
### Documentation elements
- Instrument name
- location: WikimediaEvents- Stream name
- https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikimediaEvents/+/refs/heads/master/OWNERS.md#scroll_tracking-for-vector- Location of instrument code
- schema: analytics/product_metrics/web/base- Contact
- mediawiki.reference_previews- Schema
- schema: analytics/mediawiki/client/metrics_event- Links to docs (Instrument data specification, measurement plan, etc.)
### Outcomes
- Documentation process:
- - https://wikitech.wikibase.client.interactionmedia.org/wiki/Metrics_Platform/How_to/Create_First_Metrics_Platform_Instrument#Document_the_instrument
- schema: analytics/product_metrics/web/base - https://wikitech.wikimedia.org/wiki/Metrics_Platform/How_to/Create_First_Metrics_Platform_Instrument#Decommission_the_instrument
- wikifunctions.ui- Instrument list:
- schema: analytics/ - https://wikitech.wikimedia.org/wiki/client/metrics_eventMetrics_Platform/Instrument_list
- docs: - Redirected https://datahubwikitech.wikimedia.org/dataset/urn:li:dataset:(urn:li:datawiki/Metrics_Platform:hive,event.wikifunctions_ui,PROD)/Documentation?is_lineage_mode=false/Deployed_Streams
- mediawiki.product_metrics.wikifunctions_ui- Next steps:
- schema: analytics/mediawiki/product_metrics/wikilambda/ui_actions - Replace this process with MPIC and/or the experimental platform once those tools are available
### Considerations
- **Automation**: Using the information sources that are available right now, there's no easy way to automate a list of active Metrics Platform instruments:
- mediawiki.product_metrics.wikilambda_api - The best source is to search for `metrics_platform_client` in [ext-EventStreamConfig.php](https://gerrit.wikimedia.org/r/plugins/gitiles/operations/mediawiki-config/+/refs/heads/master/wmf-config/ext-EventStreamConfig.php). However, there are a few false positives there currently due to lingering cleanup tasks.
- schema: analytics/mediawiki/product_metrics/wikilambda/api - There are the [event stores in Hive within Datahub](https://datahub.wikimedia.org/container/urn:li:container:051a6646bcf1c3d6d2f7f93b7825bc31/Entities?is_lineage_mode=false), but these don't all represent Metrics Platform instruments. In addition, the individual tables pages only contain the information from the schemas; they don't automatically populate information about interaction data values or which contextual attributes are actually available, that information still lives only in the instrumentation spec, the instrument code, and the stream config.
- mediawiki.product_metrics.mint_for_readers- **New tools**: Metrics Platform is currently working on MPIC and the experimentation platform. Due to the potential for these tools to provide an accurate, automated list of active instruments, I don't recommend investing in other methods of automating an instrument list in the short term.
- schema: analytics/product_metrics/web/base- **Public access**: For transparency with the wider community, it's important to provide some publicly accessible information about instruments. I recommend that we ask instrument creators to publish a summary of their instrument on wiki (see the [process](https://wikitech.wikimedia.org/wiki/Metrics_Platform/How_to/Create_First_Metrics_Platform_Instrument#Document_the_instrument)), including a summary of their measurement plan and the data collected by the instrument. (See this [example from Wikilamba](https://www.mediawiki.org/wiki/Extension:WikiLambda/Metrics).) The will meet our transparency goal without asking instrument creators to move complex docs on wiki and without asking interested community members to read through long, complex Google Docs.
### QAnswered questions
- Does one stream correspond to one instrument?
- It's possible that an instrument could be composed of one or more sterams. However, in reality, it's always been the case that one instrument corresponds to one stream.
- There are a few streams in the config that I can't find anywhere in code: wikifunctions.ui and mediawiki.reference_previews
- These don't represent active instruments and should be cleaned up.
- What's the relationship between wikifunctions.ui and mediawiki.product_metrics.wikifunctions_ui?
- Based on `T355438`, it looks like wikifunctions.ui uses the old MP monoschema. mediawiki.product_metrics.wikifunctions_ui supersedes wikifunctions.ui
- Some streams (like mediawiki.reference_previews) have an `events` property inside `metrics_plaftorm_client`. What is this? Is this documented anywhere?
### Documentation elements
- Instrument name
- Stream name
- Location of instrument code
- Contact
- Schema
- Instrument data specification
- Measurement plan - This is a legacy property from a deprecated MP method.