Closed smaftoul closed 7 years ago
oh yes this is great @smaftoul very useful
Not part of my PR , but your comment on CamelCase and error logging also applies to: https://github.com/dcu/mongodb_exporter/blob/master/collector/mongodb_collector.go#L166-L168 (Which I shamelessly mostly copied ;)). Want me to fix this in this PR ? another one ?
@smaftoul can you use gofmt
to format the code? most editors have plugins to do that automatically
@dcu go fmt
done and PR rebased.
Add a profiler collector: This PR adds a collector that will, for a given database, count the number of objects in the
system.profile
collection that have been inserted during the last 30 seconds. Thesystem.profile
collection, contains, if mongodb profiler is enabled, slow requests (and might contain other requests but not sure which). Also, by default, this collection is capped to 1MB , so we cannot simply count the total number of documents in the collection, return it as-is, and userate()
to see overtime when we have slow requets.@dcu are you interested by such a collector / metric ? Do you have idea to improve it, such as , for example, be able to configure the time range for the Find().Count() ? Would this belong to the database collector ? Should I add a (configurable ?)
millis
criteria to theFind()
?