Hello,
I'm using metricbeat v6.3 & kibana v6.7.1, recently I'm trying to add my mongoDB stats to metricbeat dashboard and enabled module on mongodb under /etc/metricbeat/module.d/mongodb.yaml using following command.
sudo metricbeat modules enable mongodb
But when I restart the metricbeat service, I do see that metricbeat logs are showing some errors . getting mongodb stats.
|2019-05-28T07:10:42.802Z|ERROR|collstats/collstats.go:66|Error retrieving collection totals from Mongo instance|
|---|---|---|---|
|2019-05-28T07:10:42.820Z|ERROR|schema/schema.go:41|Error on field 'mb': Missing field: mb, Error: Key mapped not found|
|2019-05-28T07:10:42.820Z|ERROR|schema/schema.go:41|Error on field 'mb': Missing field: mb, Error: Key mappedWithJournal not found|
|2019-05-28T07:10:42.820Z|ERROR|mapstriface/mapstriface.go:80|Error accessing sub-dictionary `opcountersRepl`|
|2019-05-28T07:10:42.820Z|ERROR|mapstriface/mapstriface.go:80|Error accessing sub-dictionary `storageEngine`|
|2019-05-28T07:10:42.966Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-28T07:10:42.966Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-28T07:10:42.968Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-28T07:10:42.968Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-28T07:10:42.970Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-28T07:10:42.970Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-28T07:10:42.971Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-28T07:10:42.971Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-28T07:10:42.976Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-28T07:10:42.976Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-28T07:10:42.978Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
My mongodb instance can be directly accessed through localhost and port is 27017. Following is my metricbeat configuration file.
Hello @madurad, thanks for all the detailed information. By looking at your metricbeat mongodb configuration, it appears to be you are missing the part that enables metricsets in mongodb module, for example metricsets: ["dbstats", "status", "collstats", "metrics", "replstatus"]. This might help https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-mongodb.html#_example_configuration_23. Can you please add the missing metricsets line into your config and restart metricbeat?
But still getting the same error, could you please look more in to this.
|2019-05-29T04:00:31.439Z|ERROR|collstats/collstats.go:66|Error retrieving collection totals from Mongo instance|
|---|---|---|---|
|2019-05-29T04:00:31.445Z|ERROR|mapstriface/mapstriface.go:80|Error accessing sub-dictionary `opcountersRepl`|
|2019-05-29T04:00:31.445Z|ERROR|mapstriface/mapstriface.go:80|Error accessing sub-dictionary `storageEngine`|
|2019-05-29T04:00:31.445Z|ERROR|schema/schema.go:41|Error on field 'mb': Missing field: mb, Error: Key mapped not found|
|2019-05-29T04:00:31.445Z|ERROR|schema/schema.go:41|Error on field 'mb': Missing field: mb, Error: Key mappedWithJournal not found|
|2019-05-29T04:00:31.511Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-29T04:00:31.511Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-29T04:00:31.513Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-29T04:00:31.514Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-29T04:00:31.515Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
|2019-05-29T04:00:31.515Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-29T04:00:31.517Z|ERROR|schema/schema.go:41|Error on field 'db': Missing field: db, Error: Key db not found: key not found|
|2019-05-29T04:00:31.517Z|ERROR|schema/schema.go:41|Error on field 'collections': Missing field: collections, Error: Key collections not found|
Besides that, we also did some changes in mapstriface.go in newer version of Metricbeat. I see you are using metricbeat v6.3 for now, is is possible to upgrade metricbeat to a newer version?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.