o2r-project / o2r-contentbutler

Superseeded by https://github.com/o2r-project/o2r-transporter
http://o2r.info
Apache License 2.0
0 stars 1 forks source link

Add statistics and log collection infrastructure #6

Open nuest opened 8 years ago

nuest commented 8 years ago

We have a Piwik instance running, so we could use it's reporting API to observe direkt calls to the API (which might not come from our website).

Alternatively (or preferably, we can simply analyse the nginx and webapp logs. See discussion below.

Tasks

JanKoppe commented 8 years ago

I'm not convinced that piwik should be integrated in our services. A cleaner solution would be to use nginx's log files, i.e. https://piwik.org/log-analytics/. This would a) not introduce more dependencies into the services and b) centralize the connection between API access and analytics.

nuest commented 8 years ago

I see your point, and Piwik Log Analytics look promising.

Another alternative would be collecting and analysing the logs with the ELK stack. This would require us to log the relevant information, though!

@JanKoppe Is it currently the case that all "timed" events (start of X, end of X) are written to the log? These statements must also be connected, for example via a request identifier. And the "end" statements should/must include a field saying "execution took X ms". Right?

JanKoppe commented 8 years ago

No, as of now the execution time for a request is not logged. I'm pretty sure that this is possible with nginx though, that should be done for the access_log. If not, we could extend the middleware in the microservices that logs every request (i.e. `GET request for …). Should be doable.

Also, I'm not sure if Piwik is really the best tool for performance analysis of the API. Something like Prometheus would be more suitable IMO.

nuest commented 8 years ago

I agree and updated the first comment accordingly.