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

collstats metrics for shard cluster is incomplete #824

Closed abelite-fang closed 1 month ago

abelite-fang commented 3 months ago

Describe the bug We are using mongodb_exporter on our shard cluster via SRV record, the collstats metrics like mongodb_collstats_storageStats_count{} return single shard count, and there is no label to identify which shard it is.

To Reproduce Steps to reproduce the behavior:

  1. Parameters:
    
    serviceMonitor:
    enabled: true
    interval: 10s
    scrapeTimeout: 9s
    additionalLabels:
    release: prometheus-operator
    metricRelabelings:
    - targetLabel: cl_name
      replacement: core

existingSecret: name: "prometheus-mongodb-exporter" key: "mongodb-uri"

extraArgs:

  1. connection string set to SRV record, and designate collection label to a sharded collection, exporter will only return single shard collstats.

Expected behavior Expect to have collstats (e.g. document counts, logical data size, etc.) for each shard on a sharded cluster, identify by shard name (replicaset name) or any other label.

Logs no relevance error log.

Environment

igroene commented 1 month ago

the rs_nm label should be useful to know which shard it belongs to