-
Notifications
You must be signed in to change notification settings - Fork 447
Fix: Skip the non-exist namespaces when there are multiple mongo instance metrics to scrape #1146
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
…ance metrics to scrape Signed-off-by: LinPr <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #1146 +/- ##
==========================================
- Coverage 70.88% 65.09% -5.80%
==========================================
Files 28 29 +1
Lines 3569 3091 -478
==========================================
- Hits 2530 2012 -518
- Misses 904 939 +35
- Partials 135 140 +5
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:
|
@@ -183,7 +183,7 @@ func checkNamespacesForViews(ctx context.Context, client *mongo.Client, collecti | |||
} | |||
|
|||
if _, ok := namespaces[collection]; !ok { | |||
return nil, errors.Errorf("namespace %s is a view and cannot be used for collstats/indexstats", collection) | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's log that we are skipping this collection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good idea
exporter/common_test.go
Outdated
filtered, err := checkNamespacesForViews(ctx, client, []string{"testdb01.col01", "testdb01.system.views", "testdb01.view01"}) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{"testdb01.col01", "testdb01.system.views"}, filtered) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to also update the test name. also, testdb01.view01
is a view, so we should only expect testdb01.col01
in this list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah. very good, I agree with you
…ance metrics to scrape Signed-off-by: LinPr <[email protected]>
Refer to this issue: #1144
Changes: