Skip to content

monte-carlo-data/mc-agent-toolkit / skills/performance-diagnosis

monte-carlo-performance-diagnosis

Verified

Diagnoses 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.

FileKindSize
README.mdmarkdown2.3 KB
SKILL.mdskill md7.8 KB
references/investigation-tiers.mdmarkdown3.7 KB
references/query-analysis.mdmarkdown2.7 KB

references/investigation-tiers.md

View on GitHub
# Investigation Tiers

The performance diagnosis workflow uses a three-tier approach to avoid unnecessary API calls.

## Tier 1 -- Discovery (no MCONs needed)

These tools work without knowing which specific tables or jobs to investigate. Use them first.

### `get_jobs_performance`

Find slow or failing jobs across all connected platforms.

**When to use:** Starting an investigation with no specific target.

**Key parameters:**
- `integration_type` (optional): Filter to AIRFLOW, DATABRICKS, or DBT
- Results include: job name, MCON, average duration, 7-day trend, run count, failure rate

**What to look for:**
- Jobs with `runDurationTrend7d` significantly negative (getting slower)
- Jobs with high `failureRate` (>10%)
- Jobs with high `avgDuration` relative to peers

### `get_query_perf_profile`

Find the slowest query groups by total runtime.

**When to use:** Finding which queries consume the most compute.

**Key parameters:**
- `start_time` (required): ISO 8601 start of the window to profile
- `end_time` (optional): ISO 8601 end of the window
- `warehouse_id` (optional): Scope to a specific warehouse
- `query_type` (optional): "read" for SELECT queries, "write" for INSERT/CREATE/MERGE
- `sort_field` (optional): defaults to `sum_runtime` (total execution time); also `avg_runtime`, `max_runtime`, `query_count`

**What to look for:**
- Query groups with high `sum_runtime` (total compute consumed)
- Query groups with high `max_runtime` relative to `avg_runtime` (outlier executions)

## Bridge -- Job to Tables

### `get_tables_for_job`

Convert a job MCON to the table MCONs it touches.

**When to use:** After Tier 1 identifies a problematic job, before Tier 2 diagnosis.

**Key parameters:**
- `job_mcon`: The job to look up
- `integration_type`: Must match the source (AIRFLOW, DATABRICKS, DBT)

## Tier 2 -- Diagnosis (MCONs required)

These tools need specific MCONs from Tier 1 or from the user's context.

### `get_tasks_performance`

Drill into a job's individual tasks to find the bottleneck.

**When to use:** Job is slow but you don't know which task.

### `get_change_timeline`

Unified "what changed?" timeline -- the most powerful investigation tool.

**When to use:** Something got slower and you want to know why.

**What it returns (in one call):**
- Query text changes (new JOINs, filter modifications, schema changes)
- Volume shifts (row count spikes or drops)
- Airflow task failures
- dbt model failures

**What to look for:** Correlations between changes and performance shifts.

### `get_query_rca`

Root cause analysis for query failures.

**When to use:** Queries are failing and you want to know why.

**What it returns:**
- **Failed** queries: grouped by error type (timeout, permission, syntax)
- **Futile** queries: queries that run but produce no useful output
- Pre-computed groupings -- patterns are already identified

### `get_query_latency_distribution`

Latency trend over time.

**When to use:** Detecting gradual degradation.

**What to look for:**
- Step-changes in latency (sudden increase = regression from code change)
- p95 >> p50 (>5x) means outlier queries are the problem, not the average case
- Gradual upward trend means growing data volume or inefficient queries

**Key parameters:**
- `bucket` (optional): defaults to `1d` for windows ≥ 3 days, `1h` otherwise. Pass `bucket="1h"` explicitly when localizing a step change to a specific hour, or when investigating intermittent outlier patterns that vary by time of day.

### `get_asset_lineage`

Trace upstream/downstream impact.

**When to use:** Understanding what's affected by a slow table.

**Key parameters:**
- `direction="DOWNSTREAM"`: What depends on this table?
- `direction="UPSTREAM"`: What feeds this table?
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall