-
Notifications
You must be signed in to change notification settings - Fork 428
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
PMM-10072 Filter out profiler collection #589
Conversation
exporter/common.go
Outdated
var systemDBs = []string{"admin", "config", "local"} //nolint:gochecknoglobals | ||
var ( | ||
systemDBs = []string{"admin", "config", "local"} //nolint:gochecknoglobals | ||
systemCollections = []string{"system.profile"} |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
systemCollections is a global variable (gochecknoglobals)
exporter/common.go
Outdated
return collections, nil | ||
filteredCollections := []string{} | ||
for _, collection := range collections { | ||
if collection == systemCollections[0] { |
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.
if there is only one element in the systemCollections slice, could we use it as a constant variable?
Or if you plan to add more elements to systemCollections
slice later could you please write this code which will work if the slice has two or more elements, but not only one?
exporter/common.go
Outdated
var ( | ||
systemDBs = []string{"admin", "config", "local"} //nolint:gochecknoglobals | ||
systemCollections = []string{"system.profile"} | ||
) | ||
|
||
func listCollections(ctx context.Context, client *mongo.Client, database string, filterInNamespaces []string) ([]string, error) { |
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.
is it possible to add tests for the new behavior of filtering collections?
closing it as it was done in #917 |
PMM-10072 Filter out profiler collection for monitoring