Wikimedia Product/Wikimedia Product Infrastructure team/Action API request analytics

Action API request analytics will be reports and/or dashboards to track usage of the MediaWiki Action API for Wikimedia production websites. This tracking is intended to be similar to the Pageviews tracking that is currently done by the Analytics team for articles in the main namespace.

Desired outcome
Data sets providing:
 * Number of user agents coming from Labs or third party services, on a monthly basis
 * Volume of API requests coming from Labs or third party services, on a monthly basis
 * Ranking of user agents coming from Labs or third party services with a highest activity, on a monthly basis
 * Ranking of most requested actions/parameters, on a monthly basis

Data acquisition
Raw Action API requests will be tracked using MediaWiki structured logging, Kafka and Hive.


 * 1) Log events will be emitted by MediaWiki for each Action API request using a structured logging context that contains the data needed to populate the Hive tables.
 * 2) Monolog will be configured to route these log events to a Kafka topic.
 * 3) Camus will process events from the Kafka topic and load them into a raw data table in Hive.
 * Oozie will run a (daily?) Hive script to summarize the raw data table into various aggregate tables designed for specific reporting needs via ETL processing.
 * 1) Oozie will run a Hive script to discard the raw request data after processing to reduce the risk of leaking sensitive data due to a network break or malicious actor.
 * 2) Oozie will run Hive script to generate monthly summary data from the aggregate tables for export to interested parties.

Monthly reports
Number of user agents coming from Labs or third party services, on a monthly basis

Volume of API requests coming from Labs or third party services, on a monthly basis

Ranking of user agents coming from Labs or third party services with a highest activity, on a monthly basis

Ranking of most requested actions/parameters, on a monthly basis