Page MenuHomePhabricator

Emit per-operation metrics from the store read and write paths
Closed, ResolvedPublic

Description

Per-operation metrics to emit include hit rate, miss rate, cold-path-fallback rate, write rate (split into pre-generator writes and fallback writes), per-operation latency (p50/p95/p99), and error counts broken down by error class.

Per-language, per-item and per-consumer-wiki breakdowns are expected once M1 and M2 add consumers beyond abstract.wikipedia.org, and the metric cardinality should be planned for that from day one rather than retrofitted.

Event Timeline

gengh renamed this task from Emit per-operation metrics from the cache read and write paths to Emit per-operation metrics from the store read and write paths.Apr 27 2026, 6:57 PM
gengh updated the task description. (Show Details)

Write paths done. Do we want to also do the read paths now, or should we spin that off to its own task?

Jdforrester-WMF changed the task status from Open to In Progress.Jun 22 2026, 9:24 AM
Jdforrester-WMF assigned this task to ecarg.

I can start on the read paths here

Change #1304918 had a related patch set uploaded (by Ecarg; author: Ecarg):

[mediawiki/extensions/WikiLambda@master] abstract: add metrics for read path in AW article store update

https://gerrit.wikimedia.org/r/1304918

Looking into the read path initial patch, I wanted to suggest we capture the read metrics for the reader experience, not so much from the update script.

In the update script, we care how long it takes to generate the whole thing, and whether the run ends fully and successfully, or it needs retries, etc. The store reads inside the script, while they might be relevant data, it is very granular data and I don't think it gives a lot for us. At this point, I think it might be more noise than useful data.

However, the read path that I think is the most interesting to gather is the one in the Special:PreviewAbstract page, which is the code generating the output that the user will read.

There are a lot of things to capture there:

  • how long it takes!
  • whether this read is requested from a special page (e.g. Special:PreviewAbstract/Q42) or from an embedded opted-in article. You can know this from $this->getContext()->getTitle()->isSpecialPage()
  • whether the article is fully rendered or a section returned empty
  • the status of the sections (TODO a AWSection->getStatus getter, coming soon)

Change #1305068 had a related patch set uploaded (by Ecarg; author: Ecarg):

[mediawiki/extensions/WikiLambda@master] abstract: initialize user-facing read-path metrics based on update script

https://gerrit.wikimedia.org/r/1305068

Change #1305068 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] abstract: initialize user-facing read-path metrics based on update script

https://gerrit.wikimedia.org/r/1305068

Change #1304918 abandoned by Jforrester:

[mediawiki/extensions/WikiLambda@master] abstract: add metrics for script read path in AW article store update

Reason:

Let's not do this, at least for now.

https://gerrit.wikimedia.org/r/1304918