Page MenuHomePhabricator

Migrate Search SLOs to prometheus based metrics
Open, MediumPublic

Description

Search SLOs are currently built on graphite-based metrics that come through mediawiki. Eventually (hopefully this year sometime), WMF / mediawiki will migrate the last graphite-based pieces over to prometheus.

Once that work is complete, we should update our dashboard accordingly and create a corresponding grizzly dashboard.


This is a follow-up to T338009

Event Timeline

Should be moved to Blocked / Waiting. However for now I think I need to leave it in incoming until it's been triaged by the Search Platform team.

Gehel triaged this task as Medium priority.Jan 23 2024, 9:21 AM
Gehel moved this task from Incoming to Observability on the Data-Platform-SRE board.

While implementing the new Search SLOs in T431145: Implement OpenSearch SLO for linked artifacts (ST6.2.2) I looked into what happened to the four latency SLIs on SLO/Search. Here is what I found, and a question I would like to settle before we migrate anything.

Where the four SLIs stand

SLIOld Graphite seriesData today
Full text p95 < 4000 msSearch.FullTextResults.p95yes, mediawiki_WikimediaEvents_Search_FullTextResults_seconds
Autocomplete p95 < 600 msSearch.AutocompleteResults.p95yes, mediawiki_WikimediaEvents_Search_AutocompleteResults_seconds
Search preview p95 < 10000 msSearchVue.LoadPreview.p95no
MediaSearch p95 < 10000 msMediaSearchPageLoad.p95no

Full text and autocomplete were migrated by @colewhite in April 2025 under T343020: Converting MediaWiki Metrics to StatsLib, because they are emitted from WikimediaEvents. Search preview and MediaSearch emit mw.track( 'timing.…' ) from their own extensions, which statsv only forwards to Graphite, so they have had no data since Graphite went read-only on 2025-04-30 (T228380: Tech debt: sunsetting of Graphite).

None of the four was ever expressed as a generated SLO definition. The attempt, change 977770, was abandoned in January 2024 because the grizzly template needed Prometheus queries.

The question

All four measure time to render in the browser. @EBernhardson already pointed this out on T338009: Create dashboards for Search SLOs: the SLO can be missed without anything being wrong in Search. Today full text p95 is around 8.5 s, while the backend p95 for type="full_text" is around 300 ms. Almost all of that is page load, which we do not control.

So before we spend effort on migrating the two dead metrics, I would like to ask: what should these SLIs tell us?

  • If the goal is "search is working", then availability and update lag already cover it, and per query type backend latency (mediawiki_CirrusSearch_request_time_seconds by type) would extend it to full text, autocomplete, more_like and MediaSearch at once, with no new instrumentation.
  • If the goal is "the search experience is good for users", then client side timing is the right signal, but full text page load is really a web performance metric and may belong with navtiming rather than with us. Autocomplete is a better fit: it measures one narrow interaction, it has data, and it currently sits at p95 543 ms.
  • For search preview and MediaSearch it is also worth asking whether they need an SLO at all, and who would own it, before we pay for the migration.

Happy to write up whichever direction we choose. @Gehel, @EBernhardson, @RKemper, any opinions?

@pfischer I would rip out any SLIs/SLOs that don't map well to Search's actual service boundaries, so for example the client side rendering thing, that might be a good *alert* for search team (because plausibly we could accidentally break that, and also it's a real signal of degraded user experience even if it's not "our fault"), but would not be a good SLO.

Search preview and MediaSearch timing haven't had data since Graphite went read-only, so I'd just drop those. Full text and autocomplete client timing still exist and could back that alert.

Also I wouldn't hand anything off to another team, I'd just retire it entirely if it doesn't map to our boundaries well.

I think from an SLO perspective, we care most about the backend response times of the relevant query types. These should be set moreso from what level of (backend) performance is acceptable to our desired/supported user experience, rather than just taking whatever our historical latency is and anchoring there. (Hopefully there is a connection between the two however)

Full text (full_text) and autocomplete (comp_suggest) seem like good starting points to me, those are the two most critical use cases for us, and possibly more_like as well. Naturally I'd defer to whatever @EBernhardson thinks because he understands how lots of these things fit together much better than I could ever hope to. Also as I understand it there's lots of semantic search work ongoing, which I haven't been fully keeping up on so I didn't give much thought to that side of things

TL;DR: We should move to backend metrics not clientside, our core performance promise should be scaled relative to the level of performance we need for an acceptable user experience, and if we're thinking of offloading something to another team that's probably a sign that we should just toss the thing out entirely