feat: implement usage monitoring with statistical anomaly detection#42
Merged
Daniel Beer (DanielB945) merged 1 commit intomainfrom Mar 10, 2026
Merged
feat: implement usage monitoring with statistical anomaly detection#42Daniel Beer (DanielB945) merged 1 commit intomainfrom
Daniel Beer (DanielB945) merged 1 commit intomainfrom
Conversation
Major updates: - Upgrade from 2σ to 3σ threshold (99.7% confidence) - Combine SQL + Python into single usage_monitor.py script - Add statistical z-score calculations with mean and stddev - Implement severity levels: WARNING (|z| > 3), CRITICAL (|z| > 4.5) - Add investigate_root_cause.sql for enterprise drill-down - Remove duplication, apply progressive disclosure - Detect both increases and decreases in usage metrics Benefits: - Auto-adaptive thresholds (no manual tuning) - Self-contained script (SQL embedded in Python) - Cleaner structure (182 lines vs 335 lines) - Statistically sound (3σ = 99.7% confidence)
de8c472 to
4b85ee9
Compare
Daniel Beer (DanielB945)
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Autonomous usage monitoring using 3 standard deviation (3σ) statistical anomaly detection.
What Changed
usage_monitor.pyfile (303 lines)investigate_root_cause.sqlfor enterprise org-level drill-downFiles
agents/monitoring/usage/SKILL.md(182 lines) - 6-part Agent Skills specagents/monitoring/usage/usage_monitor.py(303 lines) - Combined SQL + alertingagents/monitoring/usage/investigate_root_cause.sql(85 lines) - Root cause queriesUsage
pip install google-cloud-bigquery python3 usage_monitor.py # Monitor yesterdayBenefits
✅ Auto-adaptive thresholds (no manual tuning)
✅ Self-contained script (SQL embedded)
✅ Statistically sound (3σ = 99.7% confidence)
✅ Cleaner documentation (-45% lines)
Part 2/6 of splitting PR #38
🤖 Generated with Claude Code