Have the server fragment our frontend properties by browser_family using the ua-parser library server-side. We can wildcard over this for general graphs, but it allows us to draw a more realistic picture for individual browsers (and help pinpoint problems with specific browsers), since median of everything is not very representative of real users.
|Open||None||T99060 Create a dashboard of key user-centric metrics|
|Resolved||Peter||T104902 Refactor Navigation Timing gathering to produce reliable stackable measures (aka "frontend.navtiming2")|
|Resolved||Krinkle||T112594 Separate frontend.navtiming metrics by browser family|
Hm, also, this might not be a good idea, but could be worth considering: should eventlogging-processor do this for all client-side events so that the parsed UA is easily available for anyone to use? MAYYYBE maybe not :) Probably would make the processor work much harder ¯\_(ツ)_/¯
It'd certainly simplify things a bit, but it may be better to merely make it available as a method for subscribers (rather than preprocess ahead of time). That way subscribers like Multimedia and NavTiming could do something like:
import eventlogging events = eventlogging.connect( .. ); for meta in events.filter(schema='Edit', uaMap=True): event = meta['event'] uaMap = meta['uaMap'] print uaMap['browser']['family'] print uaMap['browser']['major']
Though it's hardly advantageous compared to using the library directly:
import eventlogging import user_agent_parser events = eventlogging.connect( .. ); for meta in events.filter(schema='Edit'): event = meta['event'] uaMap = user_agent_parser.parse(meta['userAgent']) print uaMap['user_agent']['family'] print uaMap['user_agent']['major']
The main hurdle is getting uap-python packaged. Whether to install it on hafnium or eventlog1001 shouldn't matter much.
A few ideas:
- Some of the iOS_%s_WebView and iOS_%s_other entries contain periods in the key segment causing them to clobber the space for Navigation Timing properties.
- Let's break down browsers by version inside family to make it easier to group metrics from the same browser (e.g. navtiming.Chrome_Mobile.46.firstPaint).
- Rename by_platform to by_browser. Also to avoid confusion with the $Platform variable we use for desktop vs mobile.
- Rename the browsers to be more consistent with naming scheme of ua-parser per https://github.com/ua-parser/uap-core/blob/HEAD/regexes.yaml. E.g. "Chrome Mobile" (not Mobile Chrome), "Chrome Mobile iOS" (not CriOS), "Mobile Safari", "Mobile Safari WebView" etc. These names are more familiar to us I think, and also used by Analytics.
- Maybe add a generic "Other" so that we're future-proof against what proportion of browsers is outside the ones we have regexes for.