Analytics for tastypie

I want to add some kind of analytics to my Tastypie-enabled API. I really like Google Analytics for a regular website, but obviously this will not work for the API. How do you do analytics for the API as a whole? And are there any packages for Tastypie that add analytics - at least some basics: resource URL, time, agent, request headers, etc.

While I'm using Tastypie, I can ask the same question about django-piston and django-rest-framework.

+5
source share
2 answers

If you use throttle = CacheDBThrottle()in your resource, you can see the resource URL, time, request method and identifier (if you use authentication) in the tastypie_apiaccess table. However, other data, such as IP, country, user agent, request headers, etc., is still missing. You can use your own throttle class and model to save this information.

Another approach might be to use some tool to analyze server logs.

+3
source

Another tool you can try is Qmonix. This is an analytical SDK that allows you to promote any events.

Events are encoded as follows: "my_app / event / happen".

HTTP API, Qmonix -.

, Tastypie lib, HTTP.

langugage (JavaScript, Android ..) github.

0

All Articles