Closed Codecaver closed 4 months ago
Hi,
I have seen the same behaviour recently when upgrading PSMDB from v4.2.x to v4.4.x. We have a mongodb-exporter
running on each instance.
In the v4.2 PSMDB nodes the metric mongodb_mongod_replset_my_state
shows the right result (1 or 2) but in the v4.4 PSMDB nodes the mongodb_mongod_replset_my_state
value is alway 0.
The v4.4 nodes are added to the existing replicaset as a SECONDARY and hidden nodes with no priority and no votes. The replicaset is a mix versions currently due to the upgrade process.
I've also put the v4.4 nodes visible (hidden=false
) but the metric results are the same.
The logs for the mongodb-exporter in debug mode show the right state
but not in the prometheus metric.
I've been unable to reproduce the issue in previous environments or locally 😞
mongodb-exporter
options:
- "--compatible-mode"
- "--mongodb.direct-connect"
- "--mongodb.global-conn-pool"
- "--discovering-mode"
- "--collect-all"
Versions:
if you are running into this, make sure you are not disabling FTDC explicitley (enabled is default option):
diagnosticDataCollectionEnabled: true
Question I have a three-node mongo replica set with one master and two slaves. And the exporter is deployed on each node. When looking at the metrics on the master node, I found such an error metric: mongodb_mongod_replset_my_state{set="rs0"} 0. Because in rs.status(), the stats value of the primary node is 1
environment
Master-node exporter docker-compose.yaml as below:
Run command curl http://localhost:9216/metrics. Output as below: The value of mongodb_mongod_replset_my_state is 0 . And mongodb_version_info{mongodb="server version is unavailable"} 1
And I run rs.status() on the mongosh , it shows that : the value of state is 1
Moreover, this phenomenon only occurs on the exporter of the master node, and the indicators collected by the other two slave nodes are correct. It needs to be said that the exporter version of the three nodes is the same. Is this a bug? hope to get an answer.