Page MenuHomePhabricator

Monitoring for top WDQS user agents
Closed, ResolvedPublic

Description

Many WDQS incidents are triggered by individual actors putting too much strain on our system. To assist with the triaging of these issues, we need to create a dashboard to monitor the top user agents by query volume. In addition to incident responding, this dashboard will be used to better understand users and identify candidates for alternative endpoints.

There is no requirement for tooling this view should be built on (e.g. Grafana, Superset, etc.)

Incident management
90 day retention policy won't be a problem and isn't worth escalating to get around. 90 days of trailing data provides sufficient perspective on which UAs are cropping up on a given day/week, which is the level of depth we need to understand spikes in lag and incidents with our system. We want trailing data is to be able to identify when changes in volume from a given user might contribute to logjams in our infra. We want to catch when a user has been submitting ~1k requests a day for the last 80 days, and ~10k in the last 10.

Supporting workflows efficiently
If a UA has had consistent behavior for 90+ days, I think we can safely conclude it's not the sole cause of a random escalation. 90 days is enough imo to give us a sense of what a persona is using the system for. Sustained high volume/complexity querying over that time period would be an alarm for us to evaluate if they should be redirected to Wikimedia Enterprise (WME), data dumps, or GraphQL.

AC:

  • Results are ordered by unique UA string
  • Results include total query volume by UA string
  • Results update on a regular basis (minimum 10 minutes)
  • Aggregated Response Size is provided for each unique UA from a set time period (see example here)
  • (stretch) Average Query Latency is provided for each unique UA from a set time period
  • (stretch) Query Success Rate is provided for each unique UA from a set time period

Event Timeline

trueg changed the task status from Open to In Progress.Jan 21 2026, 2:37 PM
trueg claimed this task.
trueg changed the task status from In Progress to Open.Jan 22 2026, 9:58 AM
trueg changed the task status from Open to In Progress.Jan 29 2026, 1:50 PM
trueg triaged this task as High priority.

Current status:

Looks great. Please feel free to check acceptance criteria as they are addressed.

@BTracy-WMF please have a look at the Wikidata Platform Metrics WIP dashboard (https://superset.wikimedia.org/superset/dashboard/733), specifically the three "top 10" metrics.

I prepared two different approaches: 1. avg queries per day and 2. total queries in the last N days.
Which is more useful? Or do we want both?
Are the top 10 enough or should the result not be limited?

Also, as for the response size: we currently do not have this information available via the query logs. Adding it would require changes to the Blazegraph metrics extension which, at this stage, seems like unnecessary work. As such, I would propose to postpone the addition of the response size until the time when we introduce the new backend.

@BTracy-WMF By "Results are ordered by unique UA string" do you mean "grouped by UA" or actually sorted?

@trueg I have not been able to load the dashboard. Some of all of the facets fail to render whenever I load the page due to timeouts. However, here are the answers to your questions based on the demo you gave to the team. Once the dashboard can reliably load, I'll sign off on this work item:

I prepared two different approaches: 1. avg queries per day and 2. total queries in the last N days. Which is more useful? Or do we want both?

Both are useful and should be kept on the dashboard.

Are the top 10 enough or should the result not be limited?

The results should not be limited for this iteration. When and if we set RPS thresholds, we can use that limit to narrow the view.

I would propose to postpone the addition of the response size until the time when we introduce the new backend.

This is no problem, thank you for documenting the limitations of our current implementation.

By "Results are ordered by unique UA string" do you mean "grouped by UA" or actually sorted?

That's correct, UA's should be grouped and results should be ordered by the metric we are reporting for each view on the dashboard.

Due to Superset load issues, this topic will be continued and finalized in T418723