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_connections metric not available #916

Open
MehdiKammakh opened this issue Sep 23, 2024 · 9 comments
Open

mongodb_connections metric not available #916

MehdiKammakh opened this issue Sep 23, 2024 · 9 comments

Comments

@MehdiKammakh
Copy link

MehdiKammakh commented Sep 23, 2024

Describe the bug
mongodb_connections metric is not available for me

To Reproduce
Steps to reproduce the behavior:
--mongodb.uri=mongodb://mongo:27017
--mongodb.collstats-colls=planning.course
--collector.shards
--mongodb.global-conn-pool
--collector.replicasetstatus
--collector.dbstats
--collector.dbstatsfreestorage
--collector.collstats
--collector.indexstats
--collector.topmetrics

Expected behavior
mongodb_connections metrics available

Logs
Please provide logs relevant to the issue

Environment

  • Docker compose

Additional context
mongoDB docker compose

version: '3.8'
services:
mongo:
image: mongo:6.0.8
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db

percona mongodb exporter docker compose

version: '3.8'

services:
mongodb_exporter:
image: percona/mongodb_exporter:0.41.0
container_name: mongodb_exporter
hostname: mongodb_exporter
ports:
- "9216:9216"
command: >
--mongodb.uri=mongodb://mongo:27017
--mongodb.collstats-colls=planning.course
--collector.shards
--mongodb.global-conn-pool
--collector.replicasetstatus
--collector.dbstats
--collector.dbstatsfreestorage
--collector.collstats
--collector.indexstats
--collector.topmetrics
networks:
- mongodb_default
environment:
- MONGODB_USER=mongodb_exporter
- MONGODB_PASSWORD=passwordExporter

@BupycHuk
Copy link
Member

Hi @MehdiKammakh, you need to enable compatible node with --compatible-mode flag or use mongodb_ss_connections metric.

@MehdiKammakh
Copy link
Author

@BupycHuk
I have enabled --compatible-mode, still no mongodb_connections available in my metrics
and mongodb_ss_connections how to use , what do you mean by use mongodb_ss_connections metric ?
attached the metrics output
metrics-percona-mongdb.txt

@MehdiKammakh
Copy link
Author

anyone have idea about this ?
thank you

@BupycHuk
Copy link
Member

Hi, can you enable diagnostic data?

@MehdiKammakh
Copy link
Author

Hi, can you enable diagnostic data?

@BupycHuk how to do it ?

@BupycHuk
Copy link
Member

--collector.diagnosticdata

@MehdiKammakh
Copy link
Author

--collector.diagnosticdata

enabled it

`version: '3.8'

services:
mongodb_exporter:
image: percona/mongodb_exporter:0.41.0
container_name: mongodb_exporter
hostname: mongodb_exporter
ports:
- "9216:9216"
command: >
--mongodb.uri=mongodb://mongo:27017
--mongodb.collstats-colls=planning.course
--collector.shards
--mongodb.global-conn-pool
--collector.replicasetstatus
--collector.dbstats
--collector.dbstatsfreestorage
--collector.collstats
--collector.indexstats
--collector.topmetrics
--compatible-mode
--collector.diagnosticdata
networks:
- mongodb_default
environment:
- MONGODB_USER=mongodb_exporter
- MONGODB_PASSWORD=passwordExporter

networks:
mongodb_default:
external: true`

still no connections available in metrics @BupycHuk

@BupycHuk
Copy link
Member

BupycHuk commented Nov 8, 2024

Could you share metrics output one more time please?

@arianox
Copy link

arianox commented Jan 10, 2025

Had the same issue. It’s now working for me with the following command:

docker run -d -p 9216:9216 percona/mongodb_exporter:0.43.1 \ --collector.replicasetstatus \ --collector.dbstats \ --collector.topmetrics \ --collector.currentopmetrics \ --collector.diagnosticdata \ --compatible-mode \ --mongodb.uri="xxxx"

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

3 participants