-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/observability #321
Fix/observability #321
Conversation
- metrics will also be shown only for currently running pods
- repos.MatchFilter `NotInArray` support
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.
Hey @nxtcoder17 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
| } | ||
|
|
||
| func (repo *dbRepo[T]) MergeMatchFilters(filter Filter, mFilter map[string]MatchFilter) Filter { | ||
| func (repo *dbRepo[T]) MergeMatchFilters(filter Filter, matchFilters ...map[string]MatchFilter) Filter { |
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.
suggestion: Consider logging a warning instead of using fmt.Printf.
Using a logging library instead of fmt.Printf for warnings would be more consistent with best practices and allow for better log management.
| func (repo *dbRepo[T]) MergeMatchFilters(filter Filter, matchFilters ...map[string]MatchFilter) Filter { | |
| import ( | |
| "log" | |
| ) | |
| func (repo *dbRepo[T]) MergeMatchFilters(filter Filter, matchFilters ...map[string]MatchFilter) Filter { | |
| if filter == nil { | |
| filter = map[string]any{} | |
| log.Println("Warning: filter was nil, initialized to an empty map") | |
| } |
| @@ -0,0 +1,10 @@ | |||
| package functions | |||
|
|
|||
| func Reduce[T any, V any](items []T, reducerFn func(V, T), value V) V { | |||
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.
suggestion: Consider renaming reducerFn to reducer for consistency.
The parameter name reducerFn could be simplified to reducer for consistency with common naming conventions.
| func Reduce[T any, V any](items []T, reducerFn func(V, T), value V) V { | |
| func Reduce[T any, V any](items []T, reducer func(V, T), value V) V { |
| PromOperatorNotMatchRegex = PromOperator("!~") | ||
| ) | ||
|
|
||
| type PromValue struct { |
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.
issue (testing): Missing test for PromValue struct and its usage
Unit tests should be added to verify the correct usage of the PromValue struct, especially in the buildPromQuery and queryProm functions.
- observability API now communicates to target clusters via global VPN proxy, to fetch the list of currently running pods. - metrics and logs will now be shown only for currently running pods
Resolves kloudlite/kloudlite#215
observability API now communicates to target clusters via global VPN proxy, to fetch the list of currently running pods.
metrics and logs will now be shown only for currently running pods