percona / mongodb_exporter

A Prometheus exporter for MongoDB including sharding, replication and storage engines
Apache License 2.0
1.18k stars 423 forks source link

adjusting to 20.x metrics #276

Closed ghost closed 4 months ago

ghost commented 3 years ago

So I've noted a few of the changes that we'll need to make in our Grafana dashboards, but there's a few around collections that I can't seem to find. e.g. mongodb_mongod_db_collections_total{db="admin"}. I've tried running with --compatible-mode and --discovering-mode but ctrl-f'ing admin shows no results. Is there a way to get these metrics still or have they been removed?

adivinho commented 3 years ago

Have you got metrics mongodb_mongos_db_collections_total ?

ghost commented 3 years ago

MongoDB Server = 4.2.11 Exporter = 20.5 --discovering-mode --compatible-mode Only metrics with collections in the name is mongodb_ss_metrics_commands_listCollections_failed, mongodb_ss_metrics_commands_listCollections_total, mongodb_ss_metrics_commands_mergeAuthzCollections_failed and mongodb_ss_metrics_commands_mergeAuthzCollections_total

ghost commented 3 years ago

Sorry I couldn't make it to that meeting, but did you manage to discuss any of this ticket? Have collection metrics been dropped?

khuongduybui commented 3 years ago

I am running with --compatible-mode but I do not see any mongodbmongos metrics at all either

alin-grecu commented 3 years ago

I couldn't find an equivalent for mongodb_mongod_db_collections_total on replica sets either. Any updates on this?

dgdevops commented 3 years ago

Same issue here

dgdevops commented 3 years ago

Are there any plans to reintroduce these metrics?

percona-csalguero commented 3 years ago

There is an error when connecting to mongos. A quick check returns this error

mongo 127.0.0.1:17000
MongoDB shell version v4.4.7
connecting to: mongodb://127.0.0.1:17000/test?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("02f2280b-bf92-4b72-80e6-020fba128cdc") }
MongoDB server version: 4.2.15
WARNING: shell and server versions do not match
---
The server generated these startup warnings when booting:
2021-07-22T12:44:28.268+0000 I  CONTROL  [main]
2021-07-22T12:44:28.268+0000 I  CONTROL  [main] ** WARNING: Access control is not enabled for the database.
2021-07-22T12:44:28.268+0000 I  CONTROL  [main] **          Read and write access to data and configuration is unrestricted.
2021-07-22T12:44:28.268+0000 I  CONTROL  [main]
---
mongos> show databases;
uncaught exception: Error: listDatabases failed:{
        "ok" : 0,
        "errmsg" : "Could not find host matching read preference { mode: \"primary\" } for set rs1",
        "code" : 133,
        "codeName" : "FailedToSatisfyReadPreference",
        "operationTime" : Timestamp(1627207810, 1),
        "$clusterTime" : {
                "clusterTime" : Timestamp(1627207810, 1),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs/<@src/mongo/shell/mongo.js:147:19
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:99:12
shellHelper.show@src/mongo/shell/utils.js:937:13
shellHelper@src/mongo/shell/utils.js:819:15

I've created PMM-8491 to track this issue.

Thanks for the report.