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

exporter v0.37.0 cannot retrieve full metric from mongodb 6.0.3 #637

Open dandangithub2022 opened 1 year ago

dandangithub2022 commented 1 year ago

Describe the bug version v0.37.0 does not work with mongodb 6.0.3

To Reproduce Steps to reproduce the behavior:

  1. what parameters are being passed to mongodb_exporter /usr/local/bin/mongodb_exporter --mongodb.uri=mongodb://mongodb_exporter:password@127.0.0.1:27017

  2. describe steps to reproduce the issue only ~110 metric can be pull [root@denotsl3877 ~]# curl http://localhost:9216/metrics | wc -l % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 5752 0 5752 0 0 374k 0 --:--:-- --:--:-- --:--:-- 374k 114 [root@denotsl3877 ~]#

Expected behavior metric cannot be pull from mongod

Environment

xyh1304 commented 1 year ago

hi,I wonder if there is any update on this? My mongodb is also 6.0.3, exporter is 0.37, but I keep getting errors msg="Cannot connect to MongoDB: cannot connect to MongoDB: connection() error occurred during connection handshake: auth error: unable to authenticate using mechanism \"SCRAM-SHA-256\": (AuthenticationFailed) Authentication failed."

dandangithub2022 commented 1 year ago

hi xyh123321,

No I don't have any progress on this, our deployment is still on a very early stage so performance is not on top priority and we can wait for others' input on this issue.

jinchengsix commented 1 year ago

hi @dandangithub2022 I got the same error: image

I'm pretty sure that I set the user correctly: image

and I can connect from mongosh: image

my connection param: image

Based on your reply, seems It would still take a long time to solve this issue, please tell me what can I do now to get these metrics(change exporter/mongodb version for example) , thank you so much

jinchengsix commented 1 year ago

by the way , exporter version is 0.37.0 , mongodb version is 5.0

nervo commented 1 year ago

We had the same issue here, and it appears that mongodb_exporter doesn't seem to like special characters in user password :) At least, one of these: ,%!$+

In our case, changing the password fixed the issue.

Lisio commented 7 months ago

It also doesn't support MongoDB 7.0 with exporter version 0.40. I have a replica set Cannot connect to MongoDB: cannot connect to MongoDB: server selection error: context deadline exceeded, current topology: { Type: Unknown, Servers: [{ Addr: xxx.xxx.xxx.xxx:yyyyy, Type: Unknown }, ] }