Page MenuHomePhabricator

Instrument IP address copy action metric
Closed, ResolvedPublic5 Estimated Story Points

Description

Motivation

There's more context for why we want to do this in T273021: Collect metrics for IP usage and an investigation on how we could do this in T273091: Investigate: Measure how often IP addresses are copied [8H].

What we want to capture
  • Capture how often an IP address is copied on one of the page-types below
  • Capture the page type on which the copy action happened (this will give us a sense of which pages are more important in this workflow for editors to scrutinize IP edits, T263637)
    • History pages (action=history)
    • Special:RecentChanges
    • Special:Log
    • Special:Investigate
    • Special:Contributions
What we don't want to capture
  • IP addresses being copied
  • User identification of the user doing the copy action
How we want to log this

We will use statsd/Graphite for this. Helpful links:

QA prerequisites
  1. The EventLogging and WikimediaEvents extensions are installed
  2. The following lines are in your LocalSettings.php:
LocalSettings.php`
$wgWMEStatsdBaseUri = '/beacon/statsv';
$wgWMEIPAddressCopyActionEnabled = true;
QA steps
  1. Log out
  2. Make an edit to a page
  3. View the history of that page (click the "View history" tab)
  4. Copy the IP address of the most recent edit
  5. Observe that an HTTP request has been made to /beacon/statsv?MediaWiki.ipinfo_address_copy.action_history=1c after a brief delay
  6. Visit Special:RecentChanges
  7. Copy the IP address of the most recent edit
  8. Observe that an HTTP request has been made to /beacon/statsv?MediaWiki.ipinfo_address_copy.special_recentchanges=1c after a brief delay
  9. View the contributions from that IP by visiting /wiki/Special:Contributions/...
  10. Copy the IP address from the content of that page
  11. Observe that an HTTP request has been made to /beacon/statsv?MediaWiki.ipinfo_address_copy.special_contributions=1c after a brief delay

Event Timeline

Niharika created this task.
Niharika updated the task description. (Show Details)
Niharika updated the task description. (Show Details)
ARamirez_WMF added a subscriber: wikitrent.

[…] Aggregating by userid would be useful to figure out how many users do lookups on IPs, […]

From the task description:

What we don't want to capture: User identification of the user doing the copy action.

Based on the second part, I assume the former has since been reframed, but I just wanted to state explicitly that indeed I think the standard today for new instrumentation is to avoid user names/user IDs and instead use either uncorrelated "analytics session" IDs, or server-side hashed ids from a dedicated salt (see take WikimediaEvents' PageViews and VectorPrefDiffInstrumentation for good examples of this). The point being that this ensures 1) accidental disclose is unlikely to leak PII, and 2) our audience has confidence in staff and invited researchers not using the data for purposes other than what was declared ahead of time, 3) new questions that are too dissimilar naturally have to go through re-review and ensure use of a statistically valid approach.

Change 705678 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/WikimediaEvents@master] WIP Add IP address copy action instrument

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

Change 705678 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Add IP address copy action instrument

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

Change 705678 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Add IP address copy action instrument

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

FYI: I moved your cheese renamed the metric added in this patch as part of https://gerrit.wikimedia.org/r/707619. (The original hasn't gone out yet, but just in case you wrote it down somewhere).

Thanks for the note, @Krinkle.

Here are the metrics that we should expect to be tracked when the original change and @Krinkle's ride the train this week:

  • MediaWiki.ipinfo_address_copy.action_history when the user copies an IP address when viewing the history of a page
  • MediaWiki.ipinfo_address_copy.special_ + the lowercase canonical name of the special page when the user copies an IP address on one of the special pages listed in the description

Change 708488 had a related patch set uploaded (by Phuedx; author: Phuedx):

[operations/mediawiki-config@master] beta: Enable IP address copy action instrument

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

Change 708488 merged by jenkins-bot:

[operations/mediawiki-config@master] beta: Enable IP address copy action instrument

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

@imaigwilo: I've just double-checked and this should now be available to test on the Beta Cluster.

Thanks @phuedx , I was able to perform the test steps accordingly for the following pages.
The Http request loaded, please confirm the verbiage is what you expected, it is different from your notes.
MediaWiki version 1.37.0-alpha (53c539f)

History pages (action=history)

Screen Shot 2021-07-29 at 10.43.53 AM.png (1×2 px, 608 KB)

Special:RecentChanges

Screen Shot 2021-07-29 at 10.55.37 AM.png (1×1 px, 779 KB)

Special:Contributions

Screen Shot 2021-07-29 at 11.05.09 AM.png (1×2 px, 491 KB)

@Niharika Note: There where some pages I could not track the user IP address copy, see below:

Special:Log example: https://en.wikipedia.beta.wmflabs.org/wiki/Special:Log
IP address did not show on page:

Special:Investigate example: https://en.wikipedia.beta.wmflabs.org/Special:Investigate
Page not found:

The Http request loaded, please confirm the verbiage is what you expected, it is different from your notes.

Thanks, @imaigwilo. It looks like the difference between my notes and what you observed is the URL path and the counter. prefix from the bucket name. That's purely my mistake and not indicative of a bug. I'll update my notes.

Thanks @imaigwilo.

For Special:Log, I see some IPs in the Global IP block log - https://meta.wikimedia.beta.wmflabs.org/wiki/Special:Log/gblblock maybe you could check for that?

For Special:Investigate, you won't see it on between a since the extension (Checkuser) that creates that special page is not on beta. It will only be test-able once in production.

Is it okay if I move this into the QA column until the change has been tested in production?

I was able to test using the Global IP block log - https://meta.wikimedia.beta.wmflabs.org/wiki/Special:Log/gblblock, below is the screen shot of IP address copy network logging

Screen Shot 2021-07-30 at 10.22.05 PM.png (1×2 px, 495 KB)

And yes it is okay I have moved this ticket back to QA column till all changes is tested in Production.
Thanks @Niharika

Change 710313 had a related patch set uploaded (by Phuedx; author: Phuedx):

[operations/mediawiki-config@master] wikimediaEvents: Enable IP address copy action instrument on all wikis

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

Change 710313 merged by jenkins-bot:

[operations/mediawiki-config@master] wikimediaEvents: Enable IP address copy action instrument on all wikis

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

Mentioned in SAL (#wikimedia-operations) [2021-08-05T18:18:56Z] <urbanecm@deploy1002> Synchronized wmf-config/InitialiseSettings.php: 0a14eb418288ad8ea25c206d20f2bed589de8107: wikimediaEvents: Enable IP address copy action instrument on all wikis (T279540) (duration: 01m 07s)

@Niharika I get the page below in prod when I try to view the page below. https://en.wikipedia.org/wiki/Special:Investigate
Do you know who is in the Checkusers group, that I can work with to test this in prod. Thank you.

Screen Shot 2021-08-05 at 5.47.16 PM.png (938×2 px, 293 KB)

dom_walden added a subscriber: dom_walden.

We tested this on test.wikipedia.org.

On the IP & User agents tab:

special_investigate.png (1×1 px, 259 KB)

On the Timeline tab:

special_investigate_timeline.png (1×1 px, 341 KB)

The URL it logs to is https://test.wikipedia.org/beacon/statsv?MediaWiki.ipinfo_address_copy.special_investigate=1c

Test Environment: https://test.wikipedia.org MediaWiki 1.37.0-wmf.18 (c8cb410) 02:06, 10 August 2021. WikimediaEvents 1.2.0 (5844e15) 13:57, 30 July 2021.
Test Browser: Firefox 78