Page MenuHomePhabricator

ApiAction log in data lake doesn't record Wikibase API actions
Closed, InvalidPublic

Description

I wanted to get some data out of ApiAction in hadoop and it returned null for everything related to Wikibase:

0: jdbc:hive2://analytics1003.eqiad.wmnet:100> SELECT
. . . . . . . . . . . . . . . . . . . . . . .>   action, param, value, viewCount
. . . . . . . . . . . . . . . . . . . . . . .> FROM
. . . . . . . . . . . . . . . . . . . . . . .>   action_param_hourly
. . . . . . . . . . . . . . . . . . . . . . .> WHERE
. . . . . . . . . . . . . . . . . . . . . . .>   year = 2017
. . . . . . . . . . . . . . . . . . . . . . .>   AND month = 8
. . . . . . . . . . . . . . . . . . . . . . .>   AND day in(12, 13, 15, 16, 17, 18, 19, 20)
. . . . . . . . . . . . . . . . . . . . . . .>   AND action = 'wbgetentities'
. . . . . . . . . . . . . . . . . . . . . . .>   AND wiki = 'wikidatawiki'
. . . . . . . . . . . . . . . . . . . . . . .> LIMIT 50;
INFO  : Compiling command(queryId=hive_20170829172222_280df6a5-eafc-4b09-8ab3-b532f6d65db6): SELECT
  action, param, value, viewCount
FROM
  action_param_hourly
WHERE
  year = 2017
  AND month = 8
  AND day in(12, 13, 15, 16, 17, 18, 19, 20)
  AND action = 'wbgetentities'
  AND wiki = 'wikidatawiki'
LIMIT 50
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:action, type:string, comment:null), FieldSchema(name:param, type:string, comment:null), FieldSchema(name:value, type:string, comment:null), FieldSchema(name:viewcount, type:bigint, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20170829172222_280df6a5-eafc-4b09-8ab3-b532f6d65db6); Time taken: 0.379 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=hive_20170829172222_280df6a5-eafc-4b09-8ab3-b532f6d65db6): SELECT
  action, param, value, viewCount
FROM
  action_param_hourly
WHERE
  year = 2017
  AND month = 8
  AND day in(12, 13, 15, 16, 17, 18, 19, 20)
  AND action = 'wbgetentities'
  AND wiki = 'wikidatawiki'
LIMIT 50
INFO  : Completed executing command(queryId=hive_20170829172222_280df6a5-eafc-4b09-8ab3-b532f6d65db6); Time taken: 0.001 seconds
INFO  : OK
action	param	value	viewcount
No rows selected (338.934 seconds)

action=wbgetentities is one of the most used API actions of wikibase and it doesn't make sense that in 8 days we don't have any record of that. OTOH, core actions work just fine:

0: jdbc:hive2://analytics1003.eqiad.wmnet:100> SELECT
. . . . . . . . . . . . . . . . . . . . . . .>   action, param, value, viewCount
. . . . . . . . . . . . . . . . . . . . . . .> FROM
. . . . . . . . . . . . . . . . . . . . . . .>   action_param_hourly
. . . . . . . . . . . . . . . . . . . . . . .> WHERE
. . . . . . . . . . . . . . . . . . . . . . .>   year = 2017
. . . . . . . . . . . . . . . . . . . . . . .>   AND month = 7
. . . . . . . . . . . . . . . . . . . . . . .>   AND day = 12
. . . . . . . . . . . . . . . . . . . . . . .>   AND wiki = 'wikidatawiki'
. . . . . . . . . . . . . . . . . . . . . . .> LIMIT 50;
INFO  : Compiling command(queryId=hive_20170829163232_381422ec-e854-41db-80ca-4594cce5e465): SELECT
  action, param, value, viewCount
FROM
  action_param_hourly
WHERE
  year = 2017
  AND month = 7
  AND day = 12
  AND wiki = 'wikidatawiki'
LIMIT 50
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:action, type:string, comment:null), FieldSchema(name:param, type:string, comment:null), FieldSchema(name:value, type:string, comment:null), FieldSchema(name:viewcount, type:bigint, comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20170829163232_381422ec-e854-41db-80ca-4594cce5e465); Time taken: 0.165 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=hive_20170829163232_381422ec-e854-41db-80ca-4594cce5e465): SELECT
  action, param, value, viewCount
FROM
  action_param_hourly
WHERE
  year = 2017
  AND month = 7
  AND day = 12
  AND wiki = 'wikidatawiki'
LIMIT 50
INFO  : Completed executing command(queryId=hive_20170829163232_381422ec-e854-41db-80ca-4594cce5e465); Time taken: 0.0 seconds
INFO  : OK
action	param	value	viewcount
query	generator	backlinks	148
(and lots of results)

Event Timeline

See the comment at the bottom of https://wikitech.wikimedia.org/wiki/Analytics/Data_Lake/Traffic/ApiAction:

-- NOTE: there are many params we do not want to count distinct values of
-- at all (eg maxlag, smaxage, maxage, requestid, origin, centralauthtoken,
-- titles, pageids). Rather than trying to make an extensive blacklist and
-- potentially allow new parameters to slip through which have high
-- cardinality or sensitive information, the ETL process will use a whitelist
-- approach to count params that have been deemed to be useful.
--
-- The initial whitelist is (query, prop), (query, list), (query, meta),
-- (flow, module), (*, generator). The prop, list and meta parameters will
-- additionally be split on '|' with each component counted separately.

So action = 'wbgetentities' isn't one of the things that my aggregation script is computing rollup values for. This is still running out of cron as my user with local scripts on stat1005. See T137321: Run ETL for event.mediawiki_api_request into aggregate tables for the long stalled task to actually make these rollup tables official and properly manged.

@bd808 Thanks for the explanation. The gerrit patch seems to be staying there for a very long time, is there any chance that this can get out soon?

If you need someone one off however it will still be in the raw actionapi logs / table if I am not mistaken!

Addshore triaged this task as Lowest priority.Oct 8 2018, 12:58 PM

The original case for this ticket can easily be covered by the dataset in event.mediawiki_api_request directly now.

https://wikitech.wikimedia.org/wiki/Analytics/Data_Lake/Traffic/mediawiki_api_request