Skip to content

Commit 667cd46

Browse files
pierreln-ddclaude
andauthored
[mongo] Raise on serverStatus failure to surface auth and connectivity errors (DataDog#23661)
* [mongo] fall back to configured host when serverStatus hostname lookup fails Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * [mongo] add changelog entry for PR DataDog#23661 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * [mongo] shorten changelog entry for PR DataDog#23661 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * [mongo] raise on serverStatus failure to surface auth/connectivity errors Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * [mongo] simplify changelog entry for PR DataDog#23661 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent db51187 commit 667cd46

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

mongo/changelog.d/23661.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Raise exceptions from the hostname property, so permission and connectivity errors surface as check failures.

mongo/datadog_checks/mongo/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,4 @@ def hostname(self):
272272
return self.__hostname
273273
except Exception as e:
274274
self._log.error('Unable to get hostname: %s', e)
275-
return None
275+
raise

0 commit comments

Comments
 (0)