-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[poc] disable adaptive sampling on observer pipeline sources #52054
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ func (m *adSourceManager) AddSource(src *sources.LogSource) { | |
| if isContainerSource(src) && m.sp.isAgentContainerID(src.Config.Identifier) { | ||
| return | ||
| } | ||
| disableAdaptiveSampling(src.Config) | ||
| m.logSources.AddSource(src) | ||
| if isContainerSource(src) { | ||
| m.sp.suppressIdentifier(src.Config.Identifier) | ||
|
|
@@ -88,3 +89,16 @@ func isContainerSource(src *sources.LogSource) bool { | |
| } | ||
| return false | ||
| } | ||
|
|
||
| // disableAdaptiveSampling stamps an explicit Enabled=false override on cfg so that | ||
| // the decoder always picks NoopSampler for logssource sources, regardless of the | ||
| // global logs_config.experimental_adaptive_sampling.enabled flag. The observer | ||
| // pipeline must receive an unsampled stream; dropping logs here would cause the | ||
| // anomaly detection engine to miss anomalies hidden in suppressed patterns. | ||
| func disableAdaptiveSampling(cfg *logsconfig.LogsConfig) { | ||
| disabled := false | ||
| if cfg.ExperimentalAdaptiveSampling == nil { | ||
| cfg.ExperimentalAdaptiveSampling = &logsconfig.SourceAdaptiveSamplingOptions{} | ||
| } | ||
| cfg.ExperimentalAdaptiveSampling.Enabled = &disabled | ||
|
Comment on lines
+98
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| } | ||
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.
In kubelet+systemd builds,
registerKubeletJournaldSourcecreates and adds thekubeletjournald source directly (comp/anomalydetection/logssource/impl/kubelet_source.go:20-26) and never calls this helper or setsExperimentalAdaptiveSampling. Whenlogs_config.experimental_adaptive_sampling.enabledis true, the decoder falls back to that global flag for a nil source option, so the observer pipeline still samples kubelet logs even though this override is intended to make logssource streams unsampled. Please apply the same override when creating the kubelet source as well.Useful? React with 👍 / 👎.