How to display MongoDB stats in Graphite

collectdmongodbmonitoringstatsd

After googling for 2 days with no solution I would like to know if anyone uses Graphite with either CollectD or StatsD to include MongoDB statistics in a dashboard.

I was hoping for an up-to-date plugin to use with CollectD, but I only found an outdated and unfinished plugin and almost ended up creating my own StatsD helper using statsy. However, I cannot believe there is no tried and tested way to get the output of db.serverStatus() into a Graphite dashboard.

I want to display MongoDB data next to my existing Node.js, Nginx, and system stats I already have in a dashboard which is why I would like to stay with my current stack and not move to any other monitoring tools. Coming from Munin it is quite tedious to get MongoDB integrated properly.

Any suggestions which tools could be used? I would love to avoid creating my own StatsD client for the database.

update I found an interesting Python script that may be useful: https://gist.github.com/thpham/9060170

Best Answer

Here's a small process that will poll mongoldb and send server/cluster statistics to a statsd instance.

https://github.com/scullxbones/mgo-statsd

This will build a utility called mgo-statsd that will connect to a mongodb instance and on a regular interval send stats to a statsd instance. I've been running it a couple of hours and it seems to work well.

edit - replaced my previous link to the upstream repo as my patches have been accepted

Related Topic