コード例 #1
0
func main() {
	flag.Parse()
	shared.LoadGroupsDesc()
	shared.ParseEnabledGroups(*enabledGroupsFlag)

	mongodbCollector := collector.NewMongodbCollector(collector.MongodbCollectorOpts{
		URI: *mongodbUriFlag,
	})
	prometheus.MustRegister(mongodbCollector)

	startWebServer()
}
コード例 #2
0
func registerCollector() {
	mongodbCollector := collector.NewMongodbCollector(collector.MongodbCollectorOpts{
		URI:                    *mongodbURIFlag,
		TLSCertificateFile:     *mongodbTLSCert,
		TLSPrivateKeyFile:      *mongodbTLSPrivateKey,
		TLSCaFile:              *mongodbTLSCa,
		TLSHostnameValidation:  !(*mongodbTLSDisableHostnameValidation),
		CollectOplog:           *mongodbCollectOplog,
		CollectReplSet:         *mongodbCollectReplSet,
		CollectDatabaseMetrics: *mongodbCollectDatabaseMetrics,
	})
	prometheus.MustRegister(mongodbCollector)
}
コード例 #3
0
func registerCollector() {
	mongodbCollector := collector.NewMongodbCollector(collector.MongodbCollectorOpts{
		URI: *mongodbURIFlag,
	})
	prometheus.MustRegister(mongodbCollector)
}