Cannot auto discover databases and collections (pmm-client container)


After enabling --enable-all-collectors option for pmm-client we started to notice errors like:

ERRO[2022-11-23T11:31:15.784+00:00] time=“2022-11-23T11:31:15Z” level=error msg="c
annot auto discover databases and collections: cannot list the collections for "xxxx": cannot get t
he list of collections for discovery: (Unauthorized) not authorized on xxxx to execute command { listCollections: 1, filter: {}, nameOnly: true, cursor: …

ERRO[2022-11-23T11:31:15.784+00:00] time=“2022-11-23T11:31:15Z” level=error msg=“c
annot auto discover databases and collections” agentID=/agent_id/0a9ebd20-8ef4-4da1-b4ce-4e4d82b4db4b component=
agent-process type=mongodb_exporter

Seems that clusterMonitor user needs some extra roles to list collections and databases.
Tried to add { role: ‘readAnyDatabase’, db: ‘admin’ } to clusterMonitor user, but operator removes that extra role from the user.

Any ideas how to add extra roles to clusterMonitor user ?

1 Like