Page MenuHomeMiraheze

Collect Statistics for API Requests (Including Module Type)
Open, NormalPublic


It would be useful for us to get a full picture of the number of API requests we have on average in a minute/sec and then the types of modules and requests being executed. Would allow us to more quickly and easily pin point increased resource usages due to bots suddenly misusing API requests as well as guide potential caching attempts.

Event Timeline

John triaged this task as Normal priority.Mar 15 2021, 17:18
John created this task.

For this, looping over access logs may be of use (Graylog dashboards could also help?) on a minute-minute basis and reporting usages directly to either Grafana or via Prometheus may be the best option rather than setting up specific data storage services currently.

In T6979#138313, @John wrote: data could alternatively be collected directly via ES potentially

I told you on IRC yesterday, but it's good practice to document this on Phabricator: my suggestion is to use, a tool that runs on the graylog hosts. The tool takes an elasticsearch query, performs the search and returns the result in prometheus format. Prometheus collects the metrics, after which we can use the metrics in Grafana dashboards.

ACLs in elasticsearch are hard (but aren't needed so far, since elasticsearch only listens on, but the prometheus-es-exporter tool is a nice solution.
Wikimedia queries:
Puppet classes: