Page MenuHomePhabricator

๐Ÿ‘ Track GraphQL usage
Closed, ResolvedPublic8 Estimated Story Points

Description

Collect and build a Grafana dashboard that has three tiles showing the following metrics:

  • Total number of requests coming in - success vs failure
  • Max and Median latency
  • Error types (we have to define how we'll group these)
  • Usage across fields

Notes

  • execution time metrics come for free via mediawiki_special_executeTiming_seconds{special="WikibaseGraphQL"}
  • for usage across fields, we parse the query and increment a counter for each field in the AST

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptOct 6 2025, 12:17 PM

Suggestions on what to track:

  • Total number of requests coming - success v failure
  • Total number of error types
  • Latency/execution time
  • Usage across fields
Ifrahkhanyaree_WMDE set the point value for this task to 8.
Jakob_WMDE moved this task from Doing to To Do on the Wikibase Reuse Team (Sprint 61) board.
Jakob_WMDE renamed this task from Track GraphQL usage to ๐Ÿ‘ Track GraphQL usage.Jan 26 2026, 9:40 AM
Silvan_WMDE subscribed.

Currently, there is no prometheus instance for the beta cluster, so this needs to be product verified either locally before deployment or on production after the deployment (or both)

Metrics:

  • Alter the mediawiki_wikibase_graphql_hit_total to separate the requests coming from pure introspection vs requests querying data
  • When there is an introspection only request, do not track field usage

everything else works perfectly!

  • Alter the mediawiki_wikibase_graphql_hit_total to separate the requests coming from pure introspection vs requests querying data
  • When there is an introspection only request, do not track field usage

everything else works perfectly!

This is done now! If you make an introspection query, it will get tracked under mediawiki_wikibase_graphql_hit_total{status="introspection"}, and the fields will not be tracked.

Product verification concluded: all good.

some fields are not yet available, e.g.

there is no partial success in kubernetes namespace mw-api-ext for total hits yet
there is no item not found error type in mw-api-ext yet
mediawiki_special_executeTiming_seconds{special="WikibaseGraphQL"}