-
Notifications
You must be signed in to change notification settings - Fork 30
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
Feat(anomaly-connector) Log Volume Anomaly Connector #2081
base: release/v1.69.0
Are you sure you want to change the base?
Conversation
bfceebb
to
4ae03cf
Compare
b16d351
to
bf09cd9
Compare
db965bf
to
cbff773
Compare
82811b3
to
acd6c8f
Compare
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.
Two quick mod changes, haven't tested yet. Please add some tests for the config and Detector
826f8a1
to
53da5a1
Compare
MaxWindowAge time.Duration `mapstructure:"max_window_age"` | ||
// Thresholds for anomaly detection | ||
ZScoreThreshold float64 `mapstructure:"zscore_threshold"` | ||
MADThreshold float64 `mapstructure:"mad_threshold"` |
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.
Please add a comment explaining what this is
|
||
// Validate checks whether the input configuration has all of the required fields for the processor. | ||
// An error is returned if there are any invalid inputs. | ||
func (config *Config) Validate() 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.
Add tests enforcing these error cases
} | ||
|
||
// Helper to verify anomaly record | ||
func verifyAnomalyRecord(t *testing.T, record plog.LogRecord, expectedType string, expectedRate float64) { |
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.
This seems unused
} | ||
|
||
// Helper to get the first log record from LogsSink | ||
func getFirstLogRecord(t *testing.T, sink *consumertest.LogsSink) plog.LogRecord { |
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.
Also looks unused
// takeSample calculates and stores a new rate sample | ||
func (d *Detector) takeSample(now time.Time) { | ||
duration := now.Sub(d.currentBucket.start).Minutes() | ||
if duration < (1.0 / 60.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.
It might make sense to put this in a commented const
to be clearer
5953b43
to
5f49322
Compare
ce33e15
to
56673f7
Compare
56673f7
to
4c5a1fd
Compare
Proposed Change
The following PR introduces the Log volume Anomaly connector.
Checklist