Skip to content

Commit 561f21e

Browse files
authored
document required permissions for PBM collector (#1054)
* document required permissions for PBM collector * fix typo * change grammar
1 parent ffefe94 commit 561f21e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ podman run -d -p 9216:9216 percona/mongodb_exporter:0.40 --mongodb.uri=mongodb:/
6161
docker run -d -p 9216:9216 percona/mongodb_exporter:0.40 --mongodb.uri=mongodb://127.0.0.1:17001
6262
```
6363

64-
#### Permissions
64+
### Permissions
6565
Connecting user should have sufficient rights to query needed stats:
6666

6767
```
@@ -74,6 +74,24 @@ Connecting user should have sufficient rights to query needed stats:
7474
"db":"local"
7575
}
7676
```
77+
When using the PBM collector to get metrics from Percona Backup for MongoDB, the user should also have sufficient privileges
78+
to query the PBM internal collections (in the `admin` database). One option is to grant `find` privileges on the `admin` collection:
79+
```
80+
privileges: [
81+
{ resource: { db: "admin", collection: "" }, actions: [ "find" ] },
82+
],
83+
```
84+
85+
Alternatively, you can grant the `find` privilege for each PBM internal collection (see: https://docs.percona.com/percona-backup-mongodb/details/control-collections.html):
86+
```
87+
privileges: [
88+
{ resource: { db: "admin", collection: "pbmBackups" }, actions: [ "find" ] },
89+
{ resource: { db: "admin", collection: "pbmAgents" }, actions: [ "find" ] },
90+
{ resource: { db: "admin", collection: "pbmConfig" }, actions: [ "find" ] },
91+
...
92+
],
93+
```
94+
However, this is not recommended as the list of internal collections may change in future releases.
7795

7896
More info about roles in MongoDB [documentation](https://docs.mongodb.com/manual/reference/built-in-roles/#mongodb-authrole-clusterMonitor).
7997

0 commit comments

Comments
 (0)