Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove system colections from collstats #917

Merged
merged 3 commits into from
Sep 27, 2024
Merged

Remove system colections from collstats #917

merged 3 commits into from
Sep 27, 2024

Conversation

rolatsch
Copy link
Contributor

See #893 When the database profiler is enabled a system.profile collection is created for which the collection of collstats is not possible. This results in Unauthorized errors.

For example:
Sep 23 11:39:03 db-01 mongodb_exporter[53912]: time="2024-09-23T11:39:03Z" level=error msg="cannot get $collstats cursor for collection <database>.system.profile: (Unauthorized) not authorized on <database> to execute command { aggregate: \"system.profile\", pipeline: [ { $collStats: { latencyStats: { histograms: false }, storageStats: { scale: 1 } } }, { $project: { storageStats.wiredTiger: 0, storageStats.indexDetails: 0 } } ], cursor: {}, lsid: { id: UUID("<lsid>" }, $clusterTime: { clusterTime: Timestamp(<timestamp>, 1099), signature: { hash: BinData(0, <signature>), keyId: <keyid> } }, $db: \"<database>\" }" collector=collstats

Should be safe to filter out system collection when gathering collstats as it was already done for the indexstats collector.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
See #893
When the database profiler is enabled a `system.profile` collection is created for which the collection of collstats is not possible. This results in `Unauthorized` errors.

For example:
```Sep 23 11:39:03 db-01 mongodb_exporter[53912]: time="2024-09-23T11:39:03Z" level=error msg="cannot get $collstats cursor for collection <database>.system.profile: (Unauthorized) not authorized on <database> to execute command { aggregate: \"system.profile\", pipeline: [ { $collStats: { latencyStats: { histograms: false }, storageStats: { scale: 1 } } }, { $project: { storageStats.wiredTiger: 0, storageStats.indexDetails: 0 } } ], cursor: {}, lsid: { id: UUID("<lsid>" }, $clusterTime: { clusterTime: Timestamp(<timestamp>, 1099), signature: { hash: BinData(0, <signature>), keyId: <keyid> } }, $db: \"<database>\" }" collector=collstats```

Should be safe to filter out system collection when gathering collstats as it was already done for the indexstats collector.
@rolatsch rolatsch requested a review from a team as a code owner September 23, 2024 11:47
@rolatsch rolatsch requested review from BupycHuk and JiriCtvrtka and removed request for a team September 23, 2024 11:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@JiriCtvrtka JiriCtvrtka enabled auto-merge (squash) September 27, 2024 05:32
@JiriCtvrtka JiriCtvrtka merged commit c673d48 into percona:main Sep 27, 2024
6 checks passed
BupycHuk pushed a commit that referenced this pull request Oct 11, 2024

Verified

This commit was signed with the committer’s verified signature.
BupycHuk Nurlan Moldomurov
* Remove system colections from collstats

See #893
When the database profiler is enabled a `system.profile` collection is created for which the collection of collstats is not possible. This results in `Unauthorized` errors.

For example:
```Sep 23 11:39:03 db-01 mongodb_exporter[53912]: time="2024-09-23T11:39:03Z" level=error msg="cannot get $collstats cursor for collection <database>.system.profile: (Unauthorized) not authorized on <database> to execute command { aggregate: \"system.profile\", pipeline: [ { $collStats: { latencyStats: { histograms: false }, storageStats: { scale: 1 } } }, { $project: { storageStats.wiredTiger: 0, storageStats.indexDetails: 0 } } ], cursor: {}, lsid: { id: UUID("<lsid>" }, $clusterTime: { clusterTime: Timestamp(<timestamp>, 1099), signature: { hash: BinData(0, <signature>), keyId: <keyid> } }, $db: \"<database>\" }" collector=collstats```

Should be safe to filter out system collection when gathering collstats as it was already done for the indexstats collector.

* Remove whitespaces

---------

Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>
(cherry picked from commit c673d48)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants