Skip to content

Commit e182e40

Browse files
pierreln-ddclaude
andauthored
Add listIndexes to unexplainable MongoDB commands (DataDog#22825)
* [SDBM-2431] Add listIndexes to unexplainable commands listIndexes cannot be explained by MongoDB and results in IllegalOperation errors. Adding it to UNEXPLAINABLE_COMMANDS prevents the integration from attempting to explain it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Rename changelog entry to match PR number Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update changelog to be more customer-facing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 76e1c39 commit e182e40

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

mongo/changelog.d/22825.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix ``IllegalOperation`` errors in DBM explain plans caused by attempting to explain ``listIndexes`` commands.

mongo/datadog_checks/mongo/dbm/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"profile", # command to get profile level
5858
"listCollections",
5959
"listDatabases",
60+
"listIndexes",
6061
'dbStats',
6162
'createIndexes',
6263
'shardCollection',

mongo/tests/test_unit.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,13 @@ def load_json_fixture(name):
899899
True,
900900
id='ns with no collection',
901901
),
902+
pytest.param(
903+
"test.test",
904+
"command",
905+
{"listIndexes": "test", "$db": "test"},
906+
False,
907+
id='no explain listIndexes',
908+
),
902909
],
903910
)
904911
def test_should_explain_operation(namespace, op, command, should_explain):

0 commit comments

Comments
 (0)