The main RESTBase cluster needs to be configured to proxy requests to the Analytics Pageview service.
The discussion from T103811#1639220 onwards surfaced two main options:
Global vs. per-project stats
Some of the exposed page view metadata will be global (across projects), while other data will be per project or page. There are two main options for exposing this:
1) Per-project stats in each project, global stats at wikimedia.org
This would use a per-project layout like https://en.wikipedia.org/api/rest_v1/data/stats/views/enwiki/.... or https://en.wikipedia.org/api/rest_v1/stats/views/enwiki/.... , plus a similar global hierarchy at www.wikimedia.org.
2) Everything at wikimedia.org
The alternative is to expose everything in a single hierarchy. Per-project data would form a sub-hierarchy as in https://wikimedia.org/api/rest_v1/stats/{project}/views/...., in many ways mirroring the per-project hierarchy.
Discussion
- has a few advantages from the services perspective:
- Security*: Restricted access to per-project stats can be handled fairly easily in RESTBase, using the regular hierarchical ACL infrastructure.
- Discoverability: Page stats show up alongside other project API documentation, which makes it easier to discover.
- Performance: While accesses to page view data should be low volume initially, it's conceivable that gadgets or event production features would request & use this information as part of regular page views eventually. In this case, using the main project domain will lower access latency significantly by reusing an existing connection.
Advantages of the global option are:
- Single entry point for all stats: Users can be pointed to a single repository of all stats, irrespective of the project they are interested in.
See also
- T103811: Public API endpoints for new services (around about here)
- https://github.com/wikimedia/restbase/pull/343#issue-107288515 (original commit message)