Skip to content

fix(ci): use 7-day rolling average for analytics anomaly detection#258

Merged
Dbochman merged 1 commit into
mainfrom
fix/analytics-anomaly-detection
Mar 7, 2026
Merged

fix(ci): use 7-day rolling average for analytics anomaly detection#258
Dbochman merged 1 commit into
mainfrom
fix/analytics-anomaly-detection

Conversation

@Dbochman

@Dbochman Dbochman commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces day-over-day session comparison with 7-day rolling average
  • Raises threshold from -30% to -40% (relative to the rolling avg)
  • Includes actual vs average values in the alert message for easier triage

Problem

The old logic compared consecutive days, so a traffic spike ending (573→318) triggered a -45% alert even though 318 sessions is within the normal baseline (~377). This caused false positive #256.

Verification

Against March 4 data: 318 sessions vs 454 avg = -29.9% → would NOT trigger (correct)

Closes #256

Test plan

  • Verified against historical data that false positive would be avoided
  • Threshold still catches genuine drops (>40% below weekly average)
  • CI passes

🤖 Generated with Claude Code

The previous day-over-day comparison triggered false positives when traffic
returned to baseline after a spike (e.g. 573→318 = -45%, but 318 is normal).

Now compares against the 7-day rolling average with a -40% threshold, which
is more resilient to natural traffic fluctuations.

Closes #256

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Dbochman Dbochman merged commit 35660d6 into main Mar 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚨 Analytics Anomaly Detected (2026-03-04)

1 participant