Mongodb_exporter giving error after successfully connecting and showing down as a service in PMM

Description:

Service is added successfully but getting errors “context deadlne exceeded”

Steps to Reproduce:

Simply add a service using service add command.

pmm-admin add mongodb psmdb_node_1 --replication-set=ReplSet --cluster=us01 --environment=xyz --host= --port=27017 --query-source=“profiler” --username=pmmTest --password=1234567 --server-url=https://admin:xxxxxx@:443 --server-insecure-tls

Version:

ProjectName: pmm-admin

Version: 3.3.1
PMMVersion: 3.3.1

Logs:

time=“2025-08-29T09:43:05.381+00:00” level=error msg=“time=2025-08-29T09:43:05.381Z level=ERROR source=exporter.go:328 msg=\“Cannot connect to MongoDB\” error=\“cannot connect to MongoDB: context deadline exceeded\”” agentID=1055549c-b537-4947-8bb6-c86f3244cbd1 component=agent-process type=mongodb_exporter

time=“2025-08-29T09:43:07.381+00:00” level=error msg=“time=2025-08-29T09:43:07.381Z level=ERROR source=exporter.go:328 msg=\“Cannot connect to MongoDB\” error=\“cannot connect to MongoDB: context deadline exceeded\”” agentID=1055549c-b537-4947-8bb6-c86f3244cbd1 component=agent-process type=mongodb_exporter

Expected Result:

I am expecting my service to be shown as UP in pmm-server.

Actual Result:

Additional Information:

[Include any additional information that could be helpful to diagnose the issue, such as browser or device information]

Hi Saurabh,

Hope you are doing good!

I see it was having issues with connecting to the DB. Are you sure that it was connected earlier? Do you have that log?

Can you connect to this DB manually with the details you have given in pmm-admin add command? If so, how many databases/collections do you have? Similar old one - Jira . In that case, can you try add the service with options like “–skip-connection-check --max-collections-limit=10000” for pmm-client to establish a connection and disable collstats, dbstats, topmetrics and indexstats if there are more than 10k collections?

From the screenshot attached, I see mongodb_exporter in Running state. Do you see the service name added in the pmm MongoDB dashboard? We may need the log from pmm-client to look into the issue clearly.

Regards,

Vinodh Guruji