4

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

3
  • you don't want to send right to statsd unless your flush time in statsd matches your retention times in storage-schema.conf. collectd sends at a set time so its safe to send right to carbon
    – Mike
    Mar 10, 2015 at 19:15
  • I agree regarding flush times and aggregation. My problem is that I see no way to get stars into either data aggregator unless I write my own plugin to collect stats every x seconds. I find it hard to believe that there is no "standard" way of getting mongo stats into the graphite/carbon world.
    – Stephan
    Mar 10, 2015 at 20:30
  • I ended with the same results, I hope someone answers this saying "hey! I developed this one, take it!" Oct 22, 2015 at 20:36

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.