MongoHQ / newrelic-mongodb-agent

Feed MongoDB Metrics to New Relic
MIT License
16 stars 14 forks source link

Working with multiple databases #4

Open hersha opened 11 years ago

hersha commented 11 years ago

How do you set up the config file to monitor two different databases on the same system?

Winslett commented 11 years ago

Hersha, currently, you will have to run multiple processes of the agent. I will leave this open, as I consider it a priority.

jdotpz commented 11 years ago

+1 to this feature

hersha commented 10 years ago

Would this work? We have the yaml file accept an array of database names and then loop over them. Then use the following as the metric naming scheme.

report_metric("DB/#{database}/Stats/dataSize/Data Size",  "bytes",         db_stats['dataSize'])
report_metric("DB/#{database}/Stats/dataSize/Index Size", "bytes",         db_stats['indexSize'])
report_metric("DB/#{database}/Stats/Objects",             "Objects",       db_stats['objects'])
report_metric("DB/#{database}/Stats/Collections",         "Collections",   db_stats['collections'])
report_metric("DB/#{database}/Stats/Average Object Size", "Size",          db_stats['avgObjSize'])

Then update they way db_stats are collected obviously.

nand0p commented 9 years ago

+1 ...otherwise the newrelic meetme plugin supports multiple mongo dbs