Category → piwik
While all the previously described metric systems have easy protocols, they tend to stay in Sysadmin/Operations land. But you should not stop there. There is a lot more to track than CPU,Memory and Disk metrics. This blogpost is about metrics up the stack: at the Application Middleware, Application and the User Usage.
To the cloud
Maybe grumpy sysadmins have scared the developers and business to the cloud. It seems that the space of Application metrics, whether it's Ruby, Java , PHP is being ruled today by New Relic In a blogpost New Relic describes serving about 20 Billion Metrics A day.
- The New Relic - Ruby gem https://github.com/newrelic/rpm is the official one
It allows for easy instrumentation of ruby apps, but they also have support for PHP, Java, .NET, and Python
Part of their secret of success is the easy at how developers can get metrics from their application by adding a few files, and a token.
Several other cloud monitoring vendors are stepping into arena, and I really hope to see them grow the space and give some competition:
- Scout : https://scoutapp.com comes from the traditional server mangement and is slowly moving to the application metrics
- Librato : https://metrics.librato.com can lerage existing agents such as StatsD, CollectD, and JMX
- Boundary : https://boundary.com has a focus on realtime view of metrics
- DataDog: http://www.datadoghq.com goes for a complete overview of all your metrics
Some other complementary services, popular amongst developers are:
- Get Exceptional: http://www.getexceptional.com/ It tracks errors in web apps. It reports them in real-time and gathers the info you need to fix them fast.
- Airbrake: http://airbrake.io it collects errors generated by other applications, and aggregates the results for review.
- Alert grid: http://alert-grid.com/ a Workflow system , ala yahoo pipes for notifications
- Proby: http://probyapp.com/ Cron monitoring made simple
- Pingdom: http://www.pingdom.com/ Uptime and performance monitoring made easy
- Pagerduty: http://www.pagerduty.com/ Alerting that can be easily hooked into your existing monitoring solution
Check this blogpost on Monitoring Reporting Signal, Pingdom, Proby, Graphite, Monit , Pagerduty, Airbrake to see how they make a powerful team.
User tracking Metrics - Cloud
Clicks, Page view etc ...
Besides the application metrics, there is one other major player in web metrics. Google Analytics
I found several tools to get data out of it using the Google Analytics API
- Garb - A ruby wrapper for the google analytics API: https://github.com/vigetlabs/garb
- Gem for talking to Google Analytics API: https://github.com/rumble/gattica
- Google Analytics with Ruby and Garb: http://www.viget.com/extend/google-analytics-api-with-ruby-and-garb-making-it-even-easier
- More recent: Google Analytics Data Export API with Ruby + Gattica: http://www.seerinteractive.com/blog/google-analytics-data-export-api-with-rubygattica/2011/02/22
- Gattica - More recent fork by Deviantech, with goals and segment support: https://github.com/chrisle/gattica
With google Analytics there is always a delay on getting your data;
If you want to have realtime statistics/metrics checkout Gaug.es http://get.gaug.es :
- Use the Gauges gem: https://github.com/orderedlistinc/gauges-gem to import/export data
Haven't really gotten into this, but well worth exploring getting metrics out of A/B testing
- Optimizely: http://www.optimizely.com
- Visual Website Optimizer: http://visualwebsiteoptimizer.com
- Google Web Optimizer: http://www.google.com/websizeoptimizer
Page render time
Another important to track is the page render time. This is well explained in the Real User Monitoring- Chapter 10 - Complete Web Monitoring - O'Reilly Media
Again Newrelic provides RUM : Real User Monitoring. See How we provide real user monitoring: A quick technical review for more technical info
- Keynote: monitoring like a real user experiences your website - http://www.keynote.com
- Real User Monitoring New Relic - http://newrelic.com/rum
- Tracking metrics - Velvet Metrics: http://www.velvetmetrics.com
Who needs a cloud anyway
Putting your metrics into the cloud can be very convenient , but it has downsides:
- most tools don't have way to redirect/replicate the metrics they collect internally
- that makes it hard to correlate with your internal metrics
- it's easy to get metrics in, but hard to get the full/raw data out again
- it depends on the internet , duh, and sometimes this fails :)
- or privacy or the volume of metrics just isn't possible to put it out in the cloud
Application Metrics - Non - Cloud
In his epic Metrics Anywhere, Codahale explains the importance of instrumenting your code with metrics. This looks very promising as this is really driven from the developers world:
- CodaHale Metrics: https://github.com/codahale/metrics allows Capturing JVM- and application-level metrics.
- Simon Java - Simple Monitoring API: http://code.google.com/p/javasimon
- Stajistics a free monitoring and runtime performance statistics collection API for Java https://code.google.com/p/stajistics
- Parfait- Java performance framework: https://code.google.com/p/parfait
Or you can always use JMX to monitor/metrics from your application
- JMX - JR Ruby Jmx: https://github.com/enebo/jmxjr allows you to access the Mbeans as a ruby class
- An example using JMX and Jruby: https://github.com/nicksieger/advent-jruby
And with JMX-trans http://code.google.com/p/jmxtrans you can feed jmx information into Graphite, Ganglia, Cacti/Rrdtool,
- Ruby Metrics Equivalent by JohnEwart: https://github.com/johnewart/ruby-metrics
- Ruby - FnordMetric https://github.com/paulasmuth/fnordmetric is a highly configurable (and pretty fast) realtime app/event tracking thing based on ruby eventmachine and redis. You define your own plotting and counting functions as ruby blocks!
- Pinba - Monitoring Php Processing using Timers - http://pinba.org/wiki/Main_Page
- A good overview post about collecting application metrics in java
- An opensource New Relic clone : https://github.com/devmen/FreeRelic
Esty style: StatsD
To collect various metrics, Etsy has created StatD https://github.com/etsy/statsd a network daemon for aggregating statistics (counters and timers), rolling them up, then sending them to graphite.
There have been written clients in many languages php, java, ruby etc..
- Ruby gems for registering metrics with Statsd - http://rubydoc.info/gems/fozzie
- A Statsd Server in Ruby - https://github.com/fetep/ruby-statsd
- A Statsd Client in Ruby - https://github.com/github/statsd-ruby
- Another Statsd Client in Ruby - http://github.com/bvandenbos/statsd-client
- A Statsd client that isn't a direct port- https://github.com/reinh/statsd
- Statd instrumentation via Metaprogramming Methods in Ruby - https://github.com/shopify/statsd-instrument
It's incredible to see the power and simplicity of this; I've created a simple Proof of Concept to extract the statsd metrics on ZeroMQ in this experimental fork
MetricsD https://github.com/tritonrc/metricsd tries to marry both Etsy's statsD and the Coda Hale / Yammer's Metrics Library for the JVM and puts the data into Graphite. It should be drop-in compatible with Etsy's statsd, although with added explicit support for meters (with the m type) and gauges (with the g type) and introduce the h (histogram) type as an alias for timers (ms).
User tracking - Non Cloud
Clicks, Page view etc ...
Here are some Open Source Web Analytics libraries. These are merely links, haven't investigated it enough, work in progress
- Open Web Analytics
- Grape Web Statistics
- Ruwa - Ruby on Rails Web Analytics
- Riopro/piwik - ruby gem
- JKraemer piwik-tracker
- Autometal - Piwik ruby gem
- Awstats Reader - in Python
Another tool worth mentioning for tracking endusers is HummingBird - http://hummingbirdstats.com/ . It is NodeJS based an allows for realtime web traffic visualization. To send metrics is has a very simple UDP protocol.
He pointed out several A/B testing frameworks:
- ABingo : Rails A/B Testing - http://www.bingocardcreator.com/abingo
- Seven Minute Abs: Rails A/B Testing - https://github.com/paulmars/seven_minute_abs
- Vanity: Experiment Driven Development - http://vanity.labnotes.org/
And presented his own A/B Testing framework: Split - http://github.com/andrew/split
It would be interesting to integrate this further into traditional Monitoring/Metrics tools. View metrics per new version/enabled flags etc... In a Nutshell food for thought.
Page render time
For checking the page render time, I could not really found Open Source Alternatives.
It's exciting to see the cross over between both development, operations and business. Up until now only New Relic has a very well integrated suite for all metrics. Hope the internal solutions catch up.
Now that we have all that data, it's time to talk about dashboards and visualization. On to the next blogpost.
If you are using other tools, have ideas, feel free to add them in the comments.
A couple of weeks ago I noticed a weird drop in web usage stats on the site you are browsing now. Kinda weird as the drop was right around Fosdem when usually there is a spike in traffic.
So before you start.. no I don't preach on practice on my own blog, it's a blog dammit, so I do the occasional upgrades on the actual platform , with backups available, do some sanity tests and move on, yes I break the theme pretty often but ya'll reading this trough RSS anyhow.
My backups showed me that drush had made a copy of the Piwik module somewhere early february, exactly when this drop started showing. I verified the module , I verified my Piwik , - Oh Piwik you say .. yes Piwik, if you want a free alternative to Google Analytics , Piwik rocks .. - I even checked other sites using the same piwik setup and they were all still functional happily humming and being analyzed.... everything fine ... but traffic stayed low ..
This taught me I actually had to upgrade my Piwik too ...
So that brings me to the point I`m actually wanting to make...
as according to @patrickdebois in his chapter on Monitoring "Quis custodiet ipsos custodes?" who's monitoring the monitoring tools, who's monitoring the analytics tools,
So not only should you monitor the availability of yor monitoring tools, you should also monitor if their api hasn't changed in some way or another.
Just like when you are monitoring an web app you shoulnd't just see if you can connect to the appropriate http port, but you should be checking if you get sensible results back from it , no gibberish.
But then again ... there's no revenue in my blog or its statistics :)