scullxbones / mgo-statsd Goto Github PK
View Code? Open in Web Editor NEWSmall go process which polls mongodb for server status shipping as metrics to statsd
Small go process which polls mongodb for server status shipping as metrics to statsd
It would be nice to iterate on all or some configurable list of databases and send their stats.
Example:
> db.stats()
{
"db" : "main",
"collections" : 12,
"objects" : 10169918,
"avgObjSize" : 3109.8305005015773,
"dataSize" : 31626721184,
"storageSize" : 41310953280,
"numExtents" : 113,
"indexes" : 22,
"indexSize" : 2132815888,
"fileSize" : 47155511296,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"extentFreeList" : {
"num" : 0,
"totalSize" : 0
},
"ok" : 1
}
What would be the correct statsd metric naming? Which metrics to include/skip?
Would it be an initial requirement from the beginning to make it optional? And to use/have a list of included and/or excluded dbs? Initially, just iterating on all dbs would do fine.
Later, table-level metrics could possibly follow suit.
Although I'm no Go programmer, code is nicely laid out and it will make for a perfect beginner contributor task. This is why I'm asking so many questions.
Should I find time to dive into Go programming :) , I will take a stab at doing ti, but no commitment, atm.
A mongodb stack with statsd container attached works fine. But when I'm enabling the use of credentials with --auth in mongodb. The statsd container remains in status restarting, these are the logs:
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: goroutine 10 [running]:
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: panic(0x7d7140, 0xc8200b8bc0)
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: #011/usr/local/go/src/runtime/panic.go:481 +0x3e6
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: main.serverStatus(0xc8200171d0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: #011/usr/src/mgo-statsd/main.go:97 +0x2e1
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: main.main.func1(0xc820050740, 0x3b9aca00, 0xc8200171d0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x7ffe6cd82cfc, ...)
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: #011/usr/src/mgo-statsd/main.go:298 +0xc5
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: created by main.main
Sep 20 11:45:00 mongo1 docker/e50ce927e4ac[913]: #011/usr/src/mgo-statsd/main.go:307 +0xbe
Sep 20 11:45:07 mongo1 docker/e50ce927e4ac[913]: panic: not authorized on admin to execute command { serverStatus: 1 }
Can you provide some info for the use of credentials with statsd container.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.