detect-anomalies-aiops
정보
이 스킬은 시계열 분석(아이솔레이션 포레스트, Prophet, LSTM), 경고 상관관계 및 근본 원인 분석을 활용하여 운영 메트릭에 대한 AI 기반 이상 탐지를 구현합니다. 단순한 정적 임계값을 넘어 시스템 메트릭, 로그 및 트레이스에서 진정한 이상 현상을 지능적으로 식별함으로써 경고 피로를 줄입니다. 운영 팀이 경고 양에 압도될 때, 복잡한 다중 메트릭 이상을 탐지해야 할 때, 또는 계절적 패턴으로 인해 기존 임계값이 효과적이지 않을 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/detect-anomalies-aiopsClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Detect Anomalies for AIOps
See Extended Examples for complete configuration files and templates.
ML → anomalies in ops metrics + alert correlation + cut false positives.
Use When
- Ops team drowns in alerts (>100/day)
- Multi-metric anomalies (not just threshold)
- Seasonal patterns → static thresholds fail
- Predict issues before user impact
- Correlate alerts → root cause
- Monitoring → too many false positives
- Subtle perf degradation trends
In
- Required: Time series metrics (CPU, mem, latency, err rate)
- Required: Historical data (30-90 days min)
- Optional: Alert history w/ labels (TP/FP)
- Optional: Sys topology (svc deps)
- Optional: Logs → correlation
- Optional: Deploy/change events → context
Do
Step 1: Env + Load Data
Install deps + prep time series.
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install anomaly detection libraries
pip install prophet scikit-learn pandas numpy
pip install tensorflow keras # for LSTM models
pip install pyod # Python Outlier Detection library
pip install statsmodels # for statistical methods
pip install prometheus-api-client # if using Prometheus
# Visualization
pip install plotly matplotlib seaborn
Load + prep:
# aiops/data_loader.py
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
from typing import List, Dict
import logging
logging.basicConfig(level=logging.INFO)
# ... (see EXAMPLES.md for complete implementation)
→ Time series loaded w/ regular intervals, missing vals handled, features engineered.
If err: Prometheus conn fails → verify URL + net. Data gaps → forward-fill or interpolate. Ensure ts col is datetime. Mem issues on large ranges → chunks.
Step 2: Isolation Forest (Multivariate)
Unsupervised Isolation Forest.
# aiops/isolation_forest_detector.py
from sklearn.ensemble import IsolationForest
from sklearn.preprocessing import StandardScaler
import pandas as pd
import numpy as np
from typing import Dict, List
import joblib
# ... (see EXAMPLES.md for complete implementation)
→ Model trained on history, anomalies scored, typically 0.5-2% flagged.
If err: too many (>5%) → reduce contamination or retrain on cleaner baseline. Too few (<0.1%) → increase contamination or check scaling. Verify features have variance.
Step 3: Prophet (Forecast + Anomaly)
Facebook Prophet → seasonality + deviations.
# aiops/prophet_detector.py
from prophet import Prophet
import pandas as pd
import numpy as np
from typing import Dict, Tuple
import logging
logger = logging.getLogger(__name__)
# ... (see EXAMPLES.md for complete implementation)
→ Prophet captures daily/weekly seasonality, anomalies when actuals fall outside 99% CI, forecasts for capacity planning.
If err: too slow (>5 min/metric) → reduce history to 30 days or disable weekly_seasonality. Too many FP → interval_width to 0.995. Missing seasonal → custom seasonalities. TZ consistency in ts.
Step 4: Correlate Alerts + Root Cause
Group related anomalies, find causes.
# aiops/alert_correlation.py
import pandas as pd
import numpy as np
from sklearn.cluster import DBSCAN
from typing import List, Dict
from datetime import timedelta
import networkx as nx
# ... (see EXAMPLES.md for complete implementation)
→ Related anomalies → incidents, root causes via dep graph, incident summaries.
If err: all anomalies as separate → increase time_window_minutes. Root cause unclear → define metric_relationships per architecture. Verify ts sort.
Step 5: Integrate w/ Alerting
Smart alerts + noise suppress.
# aiops/intelligent_alerting.py
import requests
import logging
from typing import Dict, List
from datetime import datetime, timedelta
import json
logger = logging.getLogger(__name__)
# ... (see EXAMPLES.md for complete implementation)
→ High sev → PagerDuty, med → Slack, low → log only, dupes suppressed in 15-min window.
If err: test webhook w/ curl first. Verify severity (0.5-0.9 range). Check rate limit doesn't suppress all. TZ handling for last_alerts.
Step 6: Deploy as Continuous Svc
Auto pipeline on interval.
# aiops/monitoring_service.py
import schedule
import time
import logging
from datetime import datetime, timedelta
from data_loader import MetricsDataLoader
from isolation_forest_detector import IsolationForestDetector
from prophet_detector import ProphetAnomalyDetector
# ... (see EXAMPLES.md for complete implementation)
→ Svc runs continuous, detects every 5 min, alerts on incidents, logs all.
If err: scheduler process alive (systemd/supervisor in prod). Verify Prometheus conn. Models loaded OK. Dead man's switch if svc stops. Monitor mem (reload models periodically if grows).
Check
- History loaded w/ no missing ts
- Isolation Forest → known anomalies from test set
- Prophet captures daily/weekly seasonality
- Alert correlation groups time-related anomalies
- Root cause → upstream issues correct
- Smart alerting suppresses dupes
- Severity scores (0.5-0.9)
- Svc runs 7+ days no crash
- FP rate <10% (labeled data)
- TP rate >80% (critical incidents)
Traps
- Train on anomaly data: Baseline must be clean (no incidents). Manual review or labeled data.
- Ignore seasonality: Static models fail on daily/weekly. Prophet or time features.
- Too sensitive: 99% CI flags normal peaks. Start 99.5% + tune on FP.
- Skip missing data: Gaps → model errors. Robust preprocess + interpolate.
- Alert fatigue from low sev: Filter below threshold. High-conf only.
- Ignore topology: Treating metrics solo misses cascades. Define deps.
- Model drift: Old data → stale. Retrain monthly or on sys changes.
- Resource contention: Detecting every metric costly. Prioritize critical svcs or sample.
→
monitor-model-drift— detect when detection models degrademonitor-data-integrity— data quality before detectionsetup-prometheus-monitoring— collect ops metricsforecast-operational-metrics— capacity planning w/ Prophet
GitHub 저장소
연관 스킬
llamaguard
기타LlamaGuard는 폭력 및 혐오 발언 등 6가지 안전 범주에서 LLM 입력과 출력을 조정하기 위한 Meta의 70-80억 파라미터 모델입니다. 94-95% 정확도를 제공하며 vLLM, Hugging Face 또는 Amazon SageMaker를 사용해 배포할 수 있습니다. 이 기술을 사용하여 AI 애플리케이션에 콘텐츠 필터링 및 안전 가드레일을 손쉽게 통합하세요.
cost-optimization
기타이 Claude Skill은 리소스 적정화, 태깅 전략, 지출 분석을 통해 개발자들이 클라우드 비용을 최적화할 수 있도록 지원합니다. AWS, Azure, GCP에서 클라우드 비용을 절감하고 비용 거버넌스를 구현하기 위한 프레임워크를 제공합니다. 인프라 비용을 분석하거나, 리소스를 적정화하거나, 예산 제약을 충족해야 할 때 사용하세요.
quantizing-models-bitsandbytes
기타이 스킬은 bitsandbytes를 사용하여 LLM을 8비트 또는 4비트 정밀도로 양자화하며, 최소한의 정확도 손실로 50-75%의 메모리 감소를 달성합니다. 제한된 GPU 메모리에서 더 큰 모델을 실행하거나 추론을 가속화하는 데 이상적이며, INT8, NF4, FP4와 같은 형식을 지원합니다. 이 스킬은 HuggingFace Transformers와 통합되어 QLoRA 학습 및 8비트 옵티마이저를 가능하게 합니다.
dispatching-parallel-agents
기타이 Claude Skill은 3개 이상의 독립적인 문제를 동시에 조사하고 해결하기 위해 다중 에이전트를 배치합니다. 공유 상태나 의존성 없이 해결 가능한 무관련 장애 시나리오에 맞게 설계되었습니다. 핵심 기능은 병렬 문제 해결로, 각 독립 문제 영역마다 하나의 에이전트를 할당하여 효율성을 극대화합니다.
