percona / mongodb_exporter

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

No metric mongodb_mongos_sharding_balancer_enabled for mongos #847

Closed rkosyk closed 2 months ago

rkosyk commented 2 months ago

Describe the bug mongodb_exporter v0.36.0 and above do not have metric mongodb_mongos_sharding_balancer_enabled for the mongos This metric is used in percona MongoDB dashboard https://github.com/percona/grafana-dashboards/blob/eeb453d5b8f6d122bb394e5f12aaa11500763055/dashboards/MongoDB/MongoDB_Cluster_Summary.json#L929

mongodb_exporter v0.35.0 and below have this metric

To Reproduce

  1. what parameters are being passed to mongodb_exporter
    image: bitnami/mongodb-exporter:0.36.0 
    args:
    - --collect-all
    - --compatible-mode

Expected behavior There is mongodb_mongos_sharding_balancer_enabled metric in mongodb_exporter v0.36.0 and above

Logs When running mongodb_exporter logs in the debug mode I see this log record:

time="2024-04-30T08:39:36Z" level=debug msg="cannot create metric for balancer is enabled: mongo: no documents in result"

Environment

rkosyk commented 2 months ago

It looks like it has already been fixed in the new exporter version https://github.com/percona/mongodb_exporter/pull/823