Include the directShardOperations role for mongo user starting with mongo 8

Description

Starting with MongoDB 8.0 you can only run certain commands on shards. If you attempt to connect directly to a shard and run an unsupported command, MongoDB returns an error:

"You are connecting to a sharded cluster improperly by connecting directlyto a shard. Please connect to the cluster via a router (mongos)."

Because of that PMM client is not able to get metrics from a sharded cluster.

We need to include the directShardOperations role for mongo user starting with mongodb 8.0.

Also the Operator team needs to be aware of this and include the new permission when creating user for monitoring.

How to test

None

How to document

None

AFFECTED CS IDs

PS0002336

Activity

Show:

Aaditya Dubey 5 days ago

Hi

Thank you for the report and feedback.

Done

Details

Assignee

Reporter

Priority

Needs QA

Yes

Needs Doc

Yes

Affects versions

Due date

Smart Checklist

Created March 17, 2025 at 5:39 PM
Updated 5 days ago
Resolved 5 days ago

Flag notifications