Content translation/Public Unified Metrics Dashboard
The public dashboard with various Content Translation metrics currently lives on the public Superset instance at
https://superset.wmcloud.org/superset/dashboard/unified-cx-metrics/.
Introduction
[edit]
The dashboard features various metrics related to the usage Content (& Section) Translation tool on Wikimedia projects. As the dashboard is public, it can be accessed by anyone with a Wikimedia SUL account, with no further permissions required. The dashboard is organized with various tabs:
(D) - data is updated daily, (M) - data is updated monthly
- Monitoring metrics (D)
- This tab features metrics that are updated daily, to monitor the usage of the Content Translation, for article creation, including published and draft (in-progress) translations. Currently, monitoring metrics include new article creations only (either using CX or SX), but not translations that expansions to already published articles. Please refer to the "Key metrics (M)" tab for metrics related to the latter.
- Custom suggestions (D)
- This tab features metrics that are updated daily, to understand the usage and user interactions with the custom suggestions menu within the Content Translation.
- Key metrics (M)
- This tab features key metrics, that are updated monthly, to understand the usage of Content Translation. The filters on the left side can be used to further understand usage by namespaces, devices, creation vs. expansion, user experience levels, among others. As the data is updated monthly, the data period ends on the last day of the previous month.
- Deletion stats (M)
- This tab features metrics that are updated monthly, to explore the deletion statistics related to articles translated using either of the Content or the Section Translation tools, along with a comparative view of articles created without using these tools. As the data is updated monthly, the data period ends on the last day of the previous month.
- MT service availability (M)
- This tab provides an overview of various machine translation services available, and the language pairs they support.
- MT service usage (M)
- This tab features metrics that are updated monthly, related to the usage of various machine translation services within the Content Translation.
Usually, daily stats are updated at 5 am UTC, and monthly stats on the 5th day of each month, which includes the data until the last day of the previous month. The aggregated datasets are also published at https://analytics.wikimedia.org/published/datasets/content_translation/.
Technical aspects
[edit]The dashboard is hosted on the public Superset instance of Wikimedia, maintained by the Wikimedia Cloud Services team. The working of the dashboard involves multiple extract, transform, load pipeline, where the data is pre-aggregated to required granularity (daily or monthly), and loaded to a database to which public Superset instance is connected to.
At a high-level, at core are the Airflow DAGs, which aggregate the data from the required sources, save a snapshot internally, and also a publish a public snapshot to https://analytics.wikimedia.org/published/datasets/content_translation/ at the specified cadence. These public flat files are then picked up by Toolforge jobs, and load them to ToolsDB, which is accessed by the public Superset instance.
Primary code repos
[edit]- product-analytics/data-pipelines/content_translation
- contains queries required to tables in Data Lake, aggregation queries to be used by Airflow, queries to create TSV flat files and purge older snapshots.
- product-analytics/content-translation-airflow-jobs
- a Python job repo that helps Airflow to fetch and load data from MariaDB-replicas to Data Lake, to be used for later aggregatations, and also run scripts for certain aggregations where SQL is solely not enough (for example, MT service availability).
- airflow-dags/analytics_product/content_translations
- Airflow DAGs that execute specified queries/scripts at the specific cadence, along with managing the required dataset dependencies needed to execute. Usually, each DAG script writes a snapshot to Data Lake under
wmf_productdatabase, publishes a TSV, and purges older snapshots. - product-analytics/content-translation-toolforge-jobs
- contains job scripts to fetch public flat files, and load them to ToolsDB, under
s56759__unified_cx_metrics_pdatabase, which is connected to the public Superset instance.
Data pipelines
[edit]Load from MariaDB-replicas to Data Lake
[edit]| cx_translators_load_daily |
|---|
|
| cx_translations_load_daily |
|---|
|
| cx_corpora_load_monthly |
|---|
|
Daily aggregations
[edit]| cx_monitoring_metrics_daily |
|---|
|
| cx_suggestions_menu_interactions_daily |
|---|
|
Monthly aggregations
[edit]| cx_key_metrics_monthly |
|---|
|
| cx_deletion_stats_monthly |
|---|
|
| cx_mt_service_availability_monthly |
|---|
|
| cx_mt_service_usage_monthly |
|---|
|
| cx_mt_default_service_comparison_monthly |
|---|
|
Maintenance
[edit]The data pipelines don't specifically require any maintenance. If the Airflow DAGs fail or don't complete execution within the specified SLA duration, an automated alert will be triggered to product-analytics+alerts, and if the Toolforge job fails, alert emails will be sent to all listed maintainers of the tool.
wikimedia.org
The ToolsDB database for the dashboard is created under the tool, unified-cx-metrics-db.
- Tool admin panel: https://toolsadmin.wikimedia.org/tools/id/unified-cx-metrics-db
- Currently listed maintainers: KCVelaga (WMF)
Toolforge monthly jobs are set to run on the 5th day of the each month. For any reason, if Airflow pipelines get delayed (for instance, due to delay in mediawiki_history snapshot - even though the Toolforge job will run without any error, it will actually only update the ToolsDB database with the public snapshot available, which would be a month old. In this case, a manual update will be required using the following steps:
ssh login.toolforge.org
become unified-cx-metrics-db
cd www/python
source venv/bin/activate
cd src/scripts/python/
python update_cx_mt_service_availability.py
exit
exit