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

Hey @tarmo ,

looking into it. Just to be clear, you set it through mongodParams, right?

    enabled: enable
    image: percona/pmm-client:2.30.0
    serverHost: monitoring-service
    mongodParams: --enable-all-collectors
1 Like

Yes, I set it through mongodParams

1 Like

We are going to address it in the following tickets:

Unfortunately, I cannot think of any workaround for now.

1 Like

Hello there! I’m having the exact same issue in 1.13.
Our problem with this is that we cannot see any sharding related information in the MongoDb Cluster Summary dashboard, nor in the MongoDb Collection Details (experimental) dashboard.
Is there any way to get these dashboards working without the enable-all-collectors parameter?