-
Notifications
You must be signed in to change notification settings - Fork 449
Fix mongodb_connections metric for mongos instances #1151
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1151 +/- ##
==========================================
- Coverage 70.88% 68.77% -2.12%
==========================================
Files 28 29 +1
Lines 3569 3110 -459
==========================================
- Hits 2530 2139 -391
+ Misses 904 799 -105
- Partials 135 172 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks a lot for your contribution @vtomasr5 . If you're still up, can we add some tests for mongos instances? Maybe something similar to Additionally, you can sync this branch with current main and it should fix the duplicate metrics errors in CI. |
…nto mongodb_connections_for_mongos
…tomasr5/mongodb_exporter into mongodb_connections_for_mongos
The getDiagnosticData command returns empty data for mongos, causing connection metrics to be missing. This adds a fallback to serverStatus when getDiagnosticData returns empty data for mongos instances.
This ensures that mongodb_connections (and mongodb_ss_connections) metrics are properly exposed for mongos routers, maintaining compatibility with monitoring dashboards and alerting rules.
May fix #916