Error: descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name

Hello, I’m getting this error from the mongodb_exporter and I don’t believe I did anything special during the installation/configuration process.

descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is Desc{fqName: "mongodb_sys_mounts_var_log_capacity", help: "systemMetrics.mounts./var/log.", constLabels: {}, variableLabels: [cl_role rs_nm cl_id rs_state]}

Install Steps

wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
dpkg -i percona-release_latest.generic_all.deb
apt update
apt install -y pmm2-client
pmm-admin config --server-insecure-tls --server-url='https://REDACTED' --force --log-level=debug --debug
pmm-admin add mongodb --username=REDACTED --password=REDACTED --enable-all-collectors --cluster=REDACTED --port=27017 --host=REDACTED --replication-set=rs
pmm-admin status

Everything looks healthy, but when I try to hit the exporter directly like this… I get an empty reply:

curl localhost:42002/metrics -u "pmm:/agent_id/5f875478-554e-4304-9799-a73ff97ac943"
curl: (52) Empty reply from server

I wasn’t sure how to get the logs from the running mongodb_collector, so I started a second collector and was able to see the panic/error. Here is the full code and failure when I tried to get /metrics from this collector

# /usr/local/percona/pmm2/exporters/mongodb_exporter \
>   --collector.collstats \
>   --collector.collstats-limit=200 \
>   --collector.dbstats \
>   --collector.diagnosticdata \
>   --collector.indexstats \
>   --collector.replicasetstatus \
>   --collector.topmetrics \
>   --compatible-mode \
>   --discovering-mode \
>   --log.level=info \
>   --mongodb.global-conn-pool \
>   --web.listen-address=127.0.0.1:42003 \
>   --web.config=/usr/local/percona/pmm2/tmp/mongodb_exporter/agent_id/5f875478-554e-4304-9799-a73ff97ac943/webConfigPlaceholder \
>   --mongodb.uri="mongodb://REDACTED:REDACTED@REDACTED:27017/admin"

level=info ts=2024-01-16T21:04:00.367Z caller=tls_config.go:274 msg="Listening on" address=127.0.0.1:42003
level=info ts=2024-01-16T21:04:00.367Z caller=tls_config.go:313 msg="TLS is disabled." http2=false address=127.0.0.1:42003
2024/01/16 13:04:05 http: panic serving 127.0.0.1:60934: descriptors reported by collector have inconsistent label names or help strings for the same fully-qualified name, offender is Desc{fqName: "mongodb_sys_mounts_var_log_capacity", help: "systemMetrics.mounts./var/log.", constLabels: {}, variableLabels: [cl_role rs_nm cl_id rs_state]}
goroutine 67 [running]:
net/http.(*conn).serve.func1()
	/opt/hostedtoolcache/go/1.21.3/x64/src/net/http/server.go:1868 +0xb9
panic({0xb27d00?, 0xc0007e2f30?})
	/opt/hostedtoolcache/go/1.21.3/x64/src/runtime/panic.go:920 +0x270
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(...)
	/home/runner/go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/registry.go:406
github.com/percona/mongodb_exporter/exporter.(*Exporter).makeRegistry(0xc00031c660, {0xd731c8?, 0xc0003c2380}, 0xc0002d0000, {0xd70678?, 0xc000299260}, {{0xc0001c9ee0, 0x1, 0x1}, 0xc8, ...})
	/home/runner/work/mongodb_exporter/mongodb_exporter/exporter/exporter.go:199 +0x134b
github.com/percona/mongodb_exporter/exporter.RunWebServer.(*Exporter).Handler.func2({0xd72578, 0xc0003ec000}, 0xc0003de000)
	/home/runner/work/mongodb_exporter/mongodb_exporter/exporter/exporter.go:348 +0x648
net/http.HandlerFunc.ServeHTTP(0xc00031cb40?, {0xd72578?, 0xc0003ec000?}, 0xc00039c180?)
	/opt/hostedtoolcache/go/1.21.3/x64/src/net/http/server.go:2136 +0x29
net/http.(*ServeMux).ServeHTTP(0xc000350130?, {0xd72578, 0xc0003ec000}, 0xc0003de000)
	/opt/hostedtoolcache/go/1.21.3/x64/src/net/http/server.go:2514 +0x142
github.com/prometheus/exporter-toolkit/web.(*webHandler).ServeHTTP(0xc0001dd800, {0xd72578, 0xc0003ec000}, 0xc0003e5b50?)
	/home/runner/go/pkg/mod/github.com/prometheus/exporter-toolkit@v0.10.0/web/handler.go:136 +0x97a
net/http.serverHandler.ServeHTTP({0xc0003944e0?}, {0xd72578?, 0xc0003ec000?}, 0x6?)
	/opt/hostedtoolcache/go/1.21.3/x64/src/net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc0003da000, {0xd73120, 0xc00031cc90})
	/opt/hostedtoolcache/go/1.21.3/x64/src/net/http/server.go:2009 +0x5f4
created by net/http.(*Server).Serve in goroutine 20
	/opt/hostedtoolcache/go/1.21.3/x64/src/net/http/server.go:3086 +0x5cb

Here is the version I’m using

# /usr/local/percona/pmm2/exporters/mongodb_exporter --version
mongodb_exporter - MongoDB Prometheus exporter
Version: v0.40.0
Commit: cb3db89
Build date: 2023-11-08T07:32:28Z

And running the same exporter in debug mode, I do see a lot of DEBU[0002] $collStats metrics for ... displayed in the terminal with actual values. So it’s able to connect and pull metrics from MongoDB, but the final /metrics call fails.

Thank you,
-Ryan

I found that if I remove:

--collector.diagnosticdata

the /metrics endpoint will respond. I would like to run all collectors (because why not?), so I would still need to dig in more on why this one is causing an issue.

Found the problem… I had these two directories…

  • /var/log
  • /var/log-

Once I removed /var/log-, I was able to include diagnosticdata.

However, I feel this is only a partial solution… I’d like more configurability to allow this usecase in the future or exact matches on “/var/log” only