Skip to content

🐛 Count only error-level lines in log error bursts - #627

Merged
abahmed merged 2 commits into
mainfrom
fix-log-burst-levels
Nov 24, 2026
Merged

abahmed merged 2 commits into
mainfrom
fix-log-burst-levels

Conversation

@abahmed

@abahmed abahmed commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Log sampling counted any line containing words like error, denied, failed or timeout, whatever its level, so info lines such as level=info msg="reconcile ok" error=null fed LogErrorBurst. A quiet workload also had a baseline floor of 1, so any jump to 20 lines passed the 5x test.

Matcher (kube.IsSampledErrorLine, used only by the log sampler):

  • A line with an explicit level (logfmt level=/lvl=/severity=, JSON level/severity/lvl, klog I/W/E/F prefix, upper-case INFO/ERROR tokens at line start, after a timestamp or in brackets) counts only at error, err, fatal, panic, critical, alert or emerg. Info, debug, trace, notice and warn do not count.
  • A line with no level keeps the word heuristic, after dropping null or empty error fields (error=null, error=<nil>, err=nil, "error":null, "error":"").
  • IsErrorLine is unchanged. Other callers (crash first-error line, firstError, ErrorExcerpt, investigate pod checks) are about crash evidence and keep it.

Floor: the factor is now applied to max(rate, 8) instead of max(rate, 1), so a quiet service needs 40 lines in a window. ErrorBurstFloor stays 20.

Docs: investigation.sampleLogs row updated, with reasons: ["!LogErrorBurst"] and silences as the way to mute only this finding (Pro).

Tests: matcher table test, a sampler round test with info noise, and baseline-floor detector cases. Only affected packages run locally; CI runs the full suite.

@abahmed abahmed added the e2e Run the real-cluster E2E suite on this pull request label Nov 24, 2026
@abahmed
abahmed force-pushed the fix-log-burst-levels branch from 2e2cd9a to dedc295 Compare November 24, 2026 22:54
@abahmed
abahmed merged commit b39bca4 into main Nov 24, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run the real-cluster E2E suite on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant