Page MenuHomePhabricator

AbuseFilter / IP reputation: Instrument latency
Closed, ResolvedPublic

Description

Summary

Using IP reputation filter variables in an AbuseFilter will result in additional time needed to generate the variables for an AbuseFilter. We want a way to track how much time is being spent, to track anomalies and avoid disrupting the editing workflow process.

Background

  • Creating an IP reputation AbuseFilter variable will result in an HTTP request to iPoid-Service for a given IP address. (The results from the request are cached for 1 minute.)
  • There is a max request timeout of 2 seconds for queries to IPoid from AbuseFilter via the IPReputation service.

User story

As a TSP engineer, I want to monitor latencies involved in IP reputation variables in AbuseFilter, to avoid adding significant slowdown to edits.

Technical notes

  • We should add a Prometheus metric that tracks the time it takes to generate the value of an MediaWiki-extensions-IPReputation
    • We can't easily monitor the latency for every variable combined as the implementation means the code is called for each variable separately
    • We should consider separating the timing metric based on whether a HTTP request had to be made to get the value of the variable or whether the cache could be used
  • We probably also want to monitor the percentage of cache misses vs hits for the HTTP request

Acceptance criteria

  • Grafana dashboard for monitoring latencies

Event Timeline

Change #1138927 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPReputation@master] Measure time to get IPoid data in IPReputation

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

Change #1138927 merged by jenkins-bot:

[mediawiki/extensions/IPReputation@master] Measure time to get IPoid data in IPReputation

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

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected Per the Acceptance Criteria (Grafana dashboard for monitoring latencies).