Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb exporter could not connect to my headless service of my statefulset! #1002

Open
narjesshmida opened this issue Dec 23, 2024 · 0 comments

Comments

@narjesshmida
Copy link

narjesshmida commented Dec 23, 2024

Describe the bug
i have a statefulset of mongodb with 3 replicas and they are in the same cluster. and i configured a headless service and init job to initiate this replicas (it works very well and the replicas are initiated). and when i configured a mongodb_exporter as a deployment and point to this url : - "--mongodb.uri=mongodb://monitorUser:new_password@headless-service:27017/admin?replicaSet=rs0"
not able to connect to all instance and scrape metrics from only one replicas !

To Reproduce
Steps to reproduce the behavior:
i create a deployment with this flag for the container
containers:
- name: mongodb-exporter-ahc
image: percona/mongodb_exporter:0.42.0
command:
- "--log.level=debug"
- "--mongodb.uri=mongodb://monitorUser:new_password@headless-service:27017/admin?replicaSet=rs0"
- "--collector.replicasetstatus"
- "--collector.dbstats"
- "--collector.diagnosticdata"
- "--collector.indexstats"
- "--collector.topmetrics"
- "--collect-all"
ports:
- name: metrics
containerPort: 9216
protocol: TCP
readinessProbe:
httpGet:
path: /metrics
port: 9216
initialDelaySeconds: 30
periodSeconds: 5
failureThreshold: 6
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"

Expected behavior
i expect that mongodb_exporter could find and connect to the replicas and gather metrics from all the replicas

Environment

  • environment (docker, k8s)
  • mongodb-community-server version 7

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant