Page MenuHomePhabricator

Create grafana dashboard for stewards showing number of blocks per wiki
Open, Needs TriagePublic

Description

Stewards expressed that it would be useful to have visibility into the effect of their blocks. Adding these metrics as a grafana dashboard should be easy.

Event Timeline

csteipp claimed this task.
csteipp raised the priority of this task from to Needs Triage.
csteipp updated the task description. (Show Details)
csteipp subscribed.

I think the right way to do this following https://www.mediawiki.org/wiki/Manual:Structured_logging and add something like

LoggerFactory::getInstance( 'blocks' )->info( 'Login blocked'

array(
    'event' => 'login',
    'wiki' => wfWikiID(),
)

);

For various block actions.

Tracking blocked

  • account creations
  • logins
  • edits
  • uploads

And maybe also autoblocks created, should give a reasonable feel for how blocks are working out on each wiki.

Any other block actions where a sudden spike would be useful to see?

If we just want aggregate counts, we'd probably want to use RequestContext::getStats()->increment( '...' ) to send the data directly to graphite.

@csteipp is this something you're working on right now? I think with some more concrete details, the MW part of this could be a GCI task.

@csteipp is this something you're working on right now? I think with some more concrete details, the MW part of this could be a GCI task.

Only in my free time, which rarely happens. I think this could be a good GCI project-- one task for adding logging each place we potentially block users?

@Tgr created a grafana dashboard in the last days for something related. Maybe he's able to create one for this task as well?

The data needs to be sent to grafana (statsd) first. It's pretty easy to do, would be an ideal first step for someone towards becoming a MediaWiki hacker :)

@Tgr Thanks. Is there any docs I can have a look so I know what to code and where to send a patch (this does not prevent that any user interested in patching this can do it)? Thanks.

@Milimetric Is this data obtainable via Dashiki:Config: pages on Meta? Thanks.

Apparently this needs to be done by someone with access to grafana-admin, to which I do not have access to.

@Tgr Thanks. Is there any docs I can have a look so I know what to code and where to send a patch (this does not prevent that any user interested in patching this can do it)? Thanks.

There is some info on the graphite and grafana.wikimedia.org wikitech pages, but super user unfriendly.
It's pretty simple though: you do something like

$stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
$statd->increment( 'my.metric.name' );

and that will create a metric called MediaWiki.my.metric.name in grafana. (example, more) You can make it more complex, but metrics are not free so don't create huge amounts of them (e.g. by putting the wiki name in the metric name).

Apparently this needs to be done by someone with access to grafana-admin, to which I do not have access to.

You can sign an NDA and get included in the nda LDAP group, then you can access it (and other cool stuff like Logstash/Kibana) with your LDAP/wikitech password.
Alternatively, you can create the dashboard on the beta cluster, where grafana is open to all, and ask someone to copy it over.

@Tgr Many thanks for the info. However I don't think I'll NDA, because I do not agree to release my identity to unknown people.