ckan/ideas

Consider exposing stats/page views as "system packages"

Opened this issue · 2 comments

CKAN version
2.9.1

Describe the bug
Statistics are exposed as html tables in the /stats page. Page Views can be exported and are also exposed in the UI.
Why not "eat our own dogfood" and expose them as packages?
In that way, open data portals can optionally expose them as "open data", and for those who don't elect to, use it for more robust internal tracking using the CKAN API.

Steps to reproduce
Go to /stats page. It is presented in the UI but there is no way to retrieve it via download or API.

Expected behavior
A sysadmin can specify an org that owns the stats tables.

In this way, the sysadmin can leverage the CKAN ACL, resource views and the CKAN API to control downloads; create more robust visualizations using resource views; and to retain history for detailed reporting, especially when google analytics is not an option.

Doing this will also allow the creation of "system resources" for each package as an extended form of data/metadata about package utilization.

Agreed that presenting this information in a machine readable, easy to export format would be nice. Rather than a dataset perhaps a dedicated endpoint that outputs CSV or an action that outputs JSON would be better (then you can override auth, etc) And you can create a dataset with the endpoint as resource if you really want one.

Tranfering this to the Ideas repo.