monte-carlo-data/mc-agent-toolkit / skills/performance-diagnosis
monte-carlo-performance-diagnosis
VerifiedDiagnoses pipeline performance issues -- slow jobs, expensive queries, latency trends -- using Monte Carlo's cross-platform observability. Uses a tiered investigation approach: discover problems, bridge to affected tables, then drill into root causes. Activates when a user asks about slow pipelines, expensive queries, or performance regressions.
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 2.3 KB |
| SKILL.md | skill md | 7.8 KB |
| references/investigation-tiers.md | markdown | 3.7 KB |
| references/query-analysis.md | markdown | 2.7 KB |
references/query-analysis.md
View on GitHub# Query Analysis Patterns
## Reading performance data
### Runtime metrics
When presenting runtime data to the user, always cite the exact numbers from the tool:
- **Average runtime**: The typical execution time for a query group
- **Total runtime**: Average x run count -- represents total compute consumption
- **Runtime share**: Percentage of total warehouse compute this query consumes
- **p50 / p95**: Median and 95th percentile latency -- if p95 >> p50 (>5x), outlier executions are the problem
### Trend analysis
- **7-day trend** (`runDurationTrend7d`): Positive = getting faster, negative = getting slower
- Values near 0 may indicate insufficient data -- flag if trend confidence is low (<0.1)
- Always compare current metrics to the 7-day baseline before making claims about regressions
### Common performance patterns
**Sudden spike**: Query changed (new JOIN, removed filter, different plan). Use `get_change_timeline` to find the change. When using `get_query_latency_distribution` to confirm timing, pass `bucket="1h"` to localize the step to a specific hour.
**Gradual degradation**: Data volume growing or query becoming less efficient over time. Use `get_query_latency_distribution` to confirm the trend.
**Intermittent slowness**: Outlier executions (p95 >> p50). Often caused by: resource contention, cold warehouse startup, large partition scans on specific date ranges. Pass `bucket="1h"` to `get_query_latency_distribution` to identify which hours are outlier-heavy.
**Failed/futile patterns**: Use `get_query_rca` to group failures by cause. Common causes:
- **Timeout**: Query takes too long -- needs optimization or larger warehouse
- **Permission**: Credentials or roles changed
- **Futile**: Query runs but returns zero rows or produces no downstream effect
## Read vs write queries
- When the user asks about "expensive" or "costly" queries, investigate using runtime data
- When the user asks about "reads" or "read queries", filter with `query_type="read"` (SELECT queries)
- When the user asks about "writes", filter with `query_type="write"` (INSERT, CREATE, MERGE)
- **Never mix reads and writes** in the same result unless the user explicitly asks for both
## Cross-platform considerations
Performance data comes from multiple platforms. Note which platform each finding is from:
| Platform | Job type | Task granularity |
|----------|----------|------------------|
| Airflow | DAG runs | Task instances within DAGs |
| dbt | Model runs | Individual model executions |
| Databricks | Job runs | Notebook/task runs within jobs |
Each platform has different performance characteristics. An Airflow task taking 5 minutes might be normal; a dbt model taking 5 minutes might indicate a problem.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |