Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track API usage #72

Open
rufuspollock opened this issue Aug 16, 2014 · 6 comments
Open

Track API usage #72

rufuspollock opened this issue Aug 16, 2014 · 6 comments

Comments

@rufuspollock
Copy link
Member

We track analytics on the front end using Google Analytics or similar (e.g. piwik)

However, we don't track API usage in any systematic way. This would be useful to provide reports to users and also in order to manage API use.

Proposal

One of the simplest options would be to plug into google analytics system but from the server side using "universal analytics" - there's a python universal library here.

# as python named-arguments
tracker.send('pageview', path = "/test", title = "Test page") 

# as property dictionary 
tracker.send('pageview', {
  'path': "/test",
  'title': "Test page"
})

We could also use this to track other activity e.g. certain kinds of events:

from UniversalAnalytics import Tracker

tracker = Tracker.create('UA-XXXXX-Y', client_id = CUSTOMER_UNIQUE_ID)
tracker.send('event', 'Subscription', 'billing')

Note: afaict alternatives to GA like piwik do not support the "Measurement Protocol"

@marks
Copy link

marks commented Aug 16, 2014

+1; while there is some vendor lock-in with Google Analytics, this is something I have been thinking would be useful to CKAN users.

Another option would be to have hooks for a full-fledged API (quota) management platform of which there are several open source and COTS ones available. One resource: http://management.apievangelist.com/

@maxious
Copy link
Member

maxious commented Aug 18, 2014

I did a hacky patch to the googleanalytics extension to track API usage ckan/ckanext-googleanalytics#6

@adamamyl
Copy link

+1

@gjlawran
Copy link

gjlawran commented Nov 3, 2014

Also interested in API usage tracking. Not sure if a web analytics (GA/piwick) or daily server log processing would be the most efficient.

@adamamyl
Copy link

adamamyl commented Nov 3, 2014

I think for most people, real-time is more useful than a daily log, particularly for things like rate-limiting / quota-ing.

@gjlawran
Copy link

gjlawran commented Nov 3, 2014

@adamamyl agreed quota management / rate limiting is a whole new dimension / problem - I would just like to report to my data providers the use that their data resources see - regardless of the access mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants