Page MenuHomePhabricator

API Request Logging
Closed, ResolvedPublic

Description

We would like to collect basic statistics on how our API gets used in an EventLogging table with the following schema:

TranslationRecommendationAPIRequests:

timestamp: (required)
sourceLanguage: source language [query param] (required)
targetLanguage: target language [query param] (required)
seed: seed parameter used for searching [query param] (optional)
searchAlgorithm: search algorithm used [query param] (optional)
userName: the editors user name. Required for future functionality of getting user name based recs [query param] (optional)
origin: application making the requests: e.g CX, our UI, some tool on labs [query param] (optional)

https://meta.wikimedia.org/wiki/Schema:TranslationRecommendationAPIRequests

Event Timeline

ellery raised the priority of this task from to Needs Triage.
ellery updated the task description. (Show Details)
ellery added a project: GapFinder.
ellery moved this task from Backlog to Next Up on the GapFinder board.

Per Dario, we should talk to Ops to make sure we follow the standard procedures for API usage monitoring (by graphite or otherwise).

Is this schema set in stone? If not I would like to suggest a few changes:

  1. Change the name from "Requests" to the singular "Request"
  2. Change "s" and "t" to "sourceLanguage" and "targetLanguage"
    1. Are these going to be ISO 639-1?
  3. Change "search" to "searchAlgorithm"
  4. Change "user_name" to "userId" to align more with the Schema standards (https://www.mediawiki.org/wiki/Extension:EventLogging/Guide#Standard_data_fields)
  5. Would "campaign" make more sense than "application"?

Is this schema set in stone?

It's not.

  1. Change the name from "Requests" to the singular "Request"

Ok.

  1. Change "s" and "t" to "sourceLanguage" and "targetLanguage"

Ok.

  1. Are these going to be ISO 639-1?

yes.

  1. Change "search" to "searchAlgorithm"

Ok.

  1. Change "user_name" to "userId" to align more with the Schema standards (https://www.mediawiki.org/wiki/Extension:EventLogging/Guide#Standard_data_fields)

Ok.

  1. Would "campaign" make more sense than "application"?

"campaign" is used by our users such as CX to indicate specific theme based recommendations (such as science campaign, Wiki Medicine campaign, etc.) I think we should reserve "campaign" for that specific use-case. This being said, if "application" is not clear enough, please propose other options.

How about 'origin' instead of 'application'?

@schana There is a difference between user_names and user_ids. We can use userName instead of user_name if you prefer.

@ellery camelCase is the naming convention for event logging schemas according to here.

For user name vs user id, I was trying to capture the same information as userName with userId, being an easier to work with identifier for a mediawiki user that's also a common convention among event logging schemas.

If your intention was to have userId represent some unique token (as in the UI requests) independent of mediawiki, then I would suggest renaming it to something like userToken to avoid the ambiguity.

For archive happiness: the changes can be seen here: deployment-eventlogging03.eqiad.wmflabs # /srv/log/eventlogging