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

Empty label cl_role in all cluster nodes #622

Open javizinamic opened 1 year ago

javizinamic commented 1 year ago

Describe the bug Running latest mongodb_exporter (0.37.0) against the latest MongoDB version (6.0.4) on a sharded cluster. All nodes (shardsrv, configs and mongos) are not setting the cl_role label.

I run one exporter in every MongoDB node, connecting to localhost. Mongos: mongodb_ss_metrics_mongos_cursor_totalOpened{cl_id="63e378a89482b0e6a83f3d08",cl_role="",rs_state="0"} 2.9458051e+07

ShardNode: mongodb_members_self{cl_id="63e37c455d5063dcec0a7fcf",cl_role="",member_idx="s-mongo-sh0-rp0:27018",member_state="PRIMARY",rs_nm="zn-stg-dn-sh0",rs_state="1"} 1

/usr/local/bin/mongodb_exporter --version
mongodb_exporter - MongoDB Prometheus exporter
Version: v0.37.0
Commit: b526414
Build date: 2023-02-09T11:19:58Z

To Reproduce Steps to reproduce the behavior:

Running with params: "--web.listen-address=0.0.0.0:9216 --collect-all --discovering-mode" against a running sharded cluster on 9 nodes (3 config nodes in replicaset, 2 shards of 3 nodes in replicaset) and 2 mongos Tried all params and combinations

Expected behavior cl_role should be informed with the correct node role.

Environment Tested on Rocky Linux 8 agains a 6.0.4 MongoDB ensenmble. Exporter is installed in each node configured to connect to localhost mongo servers

BupycHuk commented 1 week ago

Hi, do you still face this error?