mongodb_exporter icon indicating copy to clipboard operation
mongodb_exporter copied to clipboard

Metrics endpoint throws "Invalid username or password"

Open somnathpawar opened this issue 2 years ago • 1 comments

Describe the bug I have MongoDB 4.2 container running on K8s. There is a side container for MongoDB exporter on the same pod. I had DCU mongodb exporter before but it seems off with MongoDB 4.2 upgrade. So now I have replaced the image with Percona docker image "percona/mongodb_exporter:0.31.0". Pod get created properly with both the containers, but somehow when I try to access the pod's /metrics endpoint for mongodb_exporter, it throws following error:

curl -m 2 http://10.210.104.101:9216/metrics
Invalid username or password

I guess that's why the Prometheus also shows "server returned HTTP status 401 Unauthorized" for this endpoint." error on it's dashboard. So metrics are not being exported.

To Reproduce Steps to reproduce the behavior:

  1. I have passed "MONGODB_URI" & "HTTP_AUTH" parameters as environment variables through Kubernetes container config.

Environment

  • OS,: Linux
  • environment (docker, k8s, etc): K8s
  • MongoDB version: 4.2.20

I am not sure if any other parameter/environment variable is required to pass the authentication details, as HTTP_AUTH has been already set with pattern as "{username}:{password}".

Can anyone help with this? Thanks in advance.

somnathpawar avatar Jun 17 '22 06:06 somnathpawar

Hi @somnathpawar ,

this exporter doesn't support HTTP_AUTH as far as I know. What that env suppose to do?

Maybe related to #380 #559

denisok avatar Sep 14 '22 13:09 denisok