The Metrics Platform (MP) is a suite of services, standard libraries, and APIs for producing and consuming data of all kinds from Wikimedia Foundation products..
The Metrics Platform provides standardized algorithms, behaviors, and basic necessities for web and app instrumentation, including:
- a predefined event schema (called the monoschema) designed for use across a wide range of projects
- easy means to add custom data to events, and enrich events with contextual data
- standardized session ID generation, consistent across MediaWiki, Android, and iOS
- standardized session expiry
- determining which events are in-sample or out-of-sample based on a specific identifier (currently: pageview, session, or app install ID).
The Metrics Platform is built on the Event Platform. A Metrics Platform client is a specialized type of Event Platform client – designed to require less work in creating instrumentation. For a summary of differences between the Metrics Platform and the Event Platform, from the code developer's perspective, see Metrics Platform/Creating An Instrument.
The development of the Metrics Platform, organized in three phases, is ongoing. The features listed above are among the results of Phase 1, and Phase 1 components may be used independently of later-phase components that are planned for development. To learn which MP components are currently available for use, see the FAQ page. The use of these components is encouraged. If you have questions that are not covered by these pages, or additional guidance is needed, feel free to create a Phabricator ticket with the project tag
Metrics-Platform-Planning, or connect on the
metrics-platform slack channel if you have access to it.
Previously, different teams implemented their own analytics solutions in isolation from one another. Those solutions were typically based on the Legacy EventLogging pipeline and, more recently, the Event Platform. The Metrics Platform is an effort to unify that previous work and to establish uniformity and consistency across platforms. Its objectives include:
- making it easier to implement and maintain instruments. The Metrics Platform will provide the APIs and protocols that MediaWiki developers need to create sophisticated instruments in as few lines of code as possible while maintaining quality, rigor, and safety.
- making it easier for analysts to support teams which are not their primary teams. Previously, every instrument has its own quirks and conventions, which need to be remembered by analyst that works with the data produced by the instrument – including analysts that are providing temporary support.
- making it easier to leverage data from multiple platforms to yield insights into how our users use our whole ecosystem of products in unison.
Additional objectives and benefits are listed at Metrics_Platform/FAQ#General_FAQs.
Currently, the JS and PHP Metrics Platform Clients only work within the EventLogging extension. Before getting started with Metrics Platform, you need to have an up-to-date MediaWiki development environment. If you do not have one, consider using MediaWiki-Docker.
Follow the instructions in this Event Platform configuration recipe for MediaWiki-Docker to set up an Event Platform (ish) environment alongside your MediaWiki development environment. Even if you have previously installed the
EventLogging extension and its dependencies, make sure you complete the instructions of the Metrics Platform section on that page. The Legacy EventLogging and Event Platform with Local Schema Repositories sections are not needed.
Metrics Platform/Creating An Instrument
Metrics Platform/Creating a Stream Configuration
Metrics Platform/Contributing to Metrics Platform Development
Metrics Platform/Implementations - The APIs provided by each Metrics Platform Client implementation and the key differences between them
Metrics Platform/Event Schema - The specification of the monoschema
Metrics Platform/Sampling Units - Additional details about the properties, defined in the monoschema, which are used as sampling units
The following pages were archived while this page and its subpages were rewritten:
- Metrics Platform/Demos
- Metrics Platform/Client - Specification of interfaces, data structures, algorithms for the Metrics Platform Clients
- Metrics Platform/Client/Implementations