Monte Carlo Performance Diagnosis Skill
Diagnose data pipeline performance issues using Monte Carlo's cross-platform observability data. This skill works across Airflow, dbt, Databricks, and warehouse query engines to find bottlenecks, detect regressions, and identify root causes using a tiered investigation approach: discover problems → bridge to affected tables → drill into root causes.
Monte Carlo tool routing (HARD RULE): Always call Monte Carlo MCP tools through this plugin's bundled server, whose fully-qualified tool names are mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool> (e.g. mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__get_alerts). Bare tool names used in this skill (get_alerts, search, get_table, …) refer to that bundled server. If the session also has a separately-configured monte-carlo-mcp server, do not route to it — it may point at a different endpoint or credentials.
Tiered methodology lives in this SKILL.md (Steps 1–4). Use the Read tool on this file (not MCP resources).
When to Use
Activate when the user:
- Asks about slow pipelines, jobs, or queries
- Wants to find expensive or costly queries
- Mentions performance regressions or degradation
- Asks "why is this pipeline slow?" or "what's using the most compute?"
- Wants to compare performance over time or find bottleneck tasks
- Asks about failed or futile query patterns
Do NOT activate when the user is:
- Investigating data quality issues → use the
prevent skill
- Looking at storage costs → use the
storage-cost-analysis skill
- Creating monitors → use the
monitoring-advisor skill
- Just querying data or exploring table contents
Prerequisites
The following MCP tools must be available via the bundled Monte Carlo MCP server (mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__*):
Discovery tools (Tier 1):
| Tool |
Purpose |
get_jobs_performance |
Find slow/failing jobs across Airflow, dbt, Databricks |
get_top_slow_queries |
Find slowest query groups by total runtime |
Bridge tool:
| Tool |
Purpose |
get_tables_for_job |
Convert job MCONs to table MCONs |
Diagnosis tools (Tier 2):
| Tool |
Purpose |
get_tasks_performance |
Drill into a job's individual tasks |
get_change_timeline |
Unified timeline of query changes, volume shifts, Airflow/dbt failures |
get_query_rca |
Root cause analysis for failed/futile queries |
get_query_latency_distribution |
Latency trend over time |
get_asset_lineage |
Trace upstream/downstream impact |
Supporting tools:
| Tool |
Purpose |
get_warehouses |
List available warehouses |
Procedure
Step 1 — Identify the scope
Determine what the user wants to investigate:
- Specific job/pipeline — User mentions a job name or pipeline.
- Specific table — User mentions a table that's slow to update.
- General discovery — User wants to find what's slow.
Call get_warehouses to list available warehouses. Match the user's context to a warehouse.
Tier 1 start: job/pipeline named → get_jobs_performance; expensive/slow queries → get_top_slow_queries; hour-level regression → get_query_latency_distribution with bucket="1h"; otherwise run both discovery tools, then present top findings before drilling.
Step 2 — Tier 1: Discovery
If you don't have specific MCONs to investigate, start with discovery:
Find slow jobs — Call get_jobs_performance with optional integration_type filter (AIRFLOW, DATABRICKS, DBT) if the user specifies a platform.
- Results include: job name, average duration, trend (7-day), run count, failure rate.
- Look for: high
avgDuration, negative runDurationTrend7d, high failure rates.
Find expensive queries — Call get_top_slow_queries with optional warehouse_id and query_type ("read" for SELECTs, "write" for INSERT/CREATE/MERGE).
- Results include: query hash, total runtime, average runtime, run count.
- Look for: queries with high total runtime or high individual execution time.
Present the top findings to the user before drilling deeper. A typical investigation needs only 3–7 tool calls.
If both discovery tools return no results: Tell the user no performance issues were found in the current time window. Suggest broadening the scope (different warehouse, longer time range, or a different platform filter).
Step 3 — Bridge: Job to Tables
After Tier 1 identifies problematic jobs, convert to table MCONs:
Call get_tables_for_job(job_mcon=..., integration_type=...) using the integration_type from the job performance results.
This gives you the table MCONs needed for Tier 2 investigation.
Step 4 — Tier 2: Diagnosis
Drill into root causes using the MCONs from discovery or the bridge:
Task bottleneck — Call get_tasks_performance to find which specific task in a job is the bottleneck.
What changed? — Call get_change_timeline. This is your most powerful tool. It returns a unified timeline of:
- Query text changes (schema modifications, new JOINs, filter changes)
- Volume shifts (row count spikes/drops)
- Airflow task failures
- dbt model failures
All in one call. Look for correlations: "query changed on day X, runtime doubled on day X+1."
Why are queries failing? — Call get_query_rca to get root cause analysis:
- Failed queries: errors, timeouts, permission issues.
- Futile queries: queries that run but produce no useful output.
- Patterns are pre-computed — the tool groups failures by cause.
Is latency degrading? — Call get_query_latency_distribution to see the trend:
- Compare p50 vs p95 — if p95 >> p50 (>5×), the problem is outlier queries.
- Look for step-changes in latency (sudden increase = regression).
- For step-change / regression-time-localization use cases, pass
bucket="1h". The default downsamples to daily on windows ≥ 3 days, which hides hour-level steps.
Trace impact — Call get_asset_lineage with direction="DOWNSTREAM" to see what's affected by a slow table, or direction="UPSTREAM" to find what feeds it.
Step 5 — Present findings
Structure your response as:
- Problem summary — What's slow and by how much (with exact numbers from tools).
- Root cause — What changed or what's causing the issue.
- Impact — What downstream systems are affected.
- Recommendations — Specific actions to fix the issue.
Hard Rules
These rules are non-negotiable and must be followed on every invocation:
- Quote tool numbers exactly. If a tool returns "1282 runs, avg 22.5s", say exactly that. Never round, estimate, or fabricate numbers.
- Always compare to baselines. Use 7-day trend data (
runDurationTrend7d) to distinguish regressions from normal variance. Flag if trend data has less than 0.1 confidence.
- Stop when you have a root cause. 3–7 tool calls is typical. More than 10 means you're over-investigating.
- Read vs write queries — never mix them. When the user asks about "reads" or "read queries", filter with
query_type="read". When they ask about "writes", use query_type="write".
- Never expose MCONs, UUIDs, or internal identifiers to the user. Use human-readable names.
- Cross-platform awareness. This skill works across Airflow, dbt, and Databricks. Note which platform each finding comes from.
- Tool routing. Always use the bundled server prefix
mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool>. Never route to a separately-configured monte-carlo-mcp server.
Pitfalls
- Default latency bucketing hides hour-level steps.
get_query_latency_distribution downsamples to daily on windows ≥ 3 days. If you're hunting for a regression that happened at a specific hour, always pass bucket="1h".
- Over-investigation. Calling more than 10 tools usually means you haven't formed a hypothesis. Stop, summarize what you know, and present findings.
- Mixing read and write query types. Passing no
query_type or mixing them produces misleading "top slow" results because write queries (INSERT/MERGE) have fundamentally different runtime profiles than reads.
- Ignoring trend confidence. A negative
runDurationTrend7d with confidence < 0.1 is noise, not a regression. Always check confidence before flagging.
- Exposing internal IDs. MCONs and UUIDs are implementation details. Users should see job names, table names, and query descriptions — never raw identifiers.
- Both discovery tools return empty. This doesn't mean "no data" — it means no performance issues in the current window. Suggest broadening scope before concluding nothing is wrong.
- Assuming platform homogeneity. A single investigation may span Airflow orchestration, dbt models, and Databricks compute. Always track which platform each finding originates from.
Verification
After completing the investigation, verify your findings are actionable:
- Numbers check — Every metric in your summary (durations, run counts, failure rates, latency percentiles) must trace back to a specific tool call's output. No fabricated or rounded values.
- Root cause linkage — Your stated root cause must reference a specific event from
get_change_timeline or a specific pattern from get_query_rca. If you can't point to one, you don't have a root cause yet.
- Impact trace — If you claim downstream impact, it must come from
get_asset_lineage with direction="DOWNSTREAM". If you claim upstream dependency, it must come from direction="UPSTREAM".
- Baseline comparison — Every "slow" or "degraded" claim must include the baseline (7-day trend or p50 vs p95 comparison). A single data point is not a regression.
- Tool call budget — Confirm you used ≤ 10 tool calls. If you exceeded this, prune the investigation and present what you have.
Related Skills
prevent — Data quality issue investigation
storage-cost-analysis — Storage cost analysis
monitoring-advisor — Monitor creation and alerting configuration
1---2name: monte-carlo-performance-diagnosis3description: Diagnoses data-pipeline slowness with Monte Carlo observability across Airflow, dbt, Databricks, and warehouse engines (slow jobs, costly queries, compute regressions). Use when the user asks why a pipeline is slow or what burns compute. Not for data-quality incidents (monte-carlo-analyze-root-cause), storage-cost analysis, or creating monitors.4license: Apache-2.05---6
7# Monte Carlo Performance Diagnosis Skill
8
9Diagnose data pipeline performance issues using Monte Carlo's cross-platform observability data. This skill works across Airflow, dbt, Databricks, and warehouse query engines to find bottlenecks, detect regressions, and identify root causes using a tiered investigation approach: discover problems → bridge to affected tables → drill into root causes.
10
11> **Monte Carlo tool routing (HARD RULE):** Always call Monte Carlo MCP tools through this plugin's bundled server, whose fully-qualified tool names are `mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool>` (e.g. `mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__get_alerts`). Bare tool names used in this skill (`get_alerts`, `search`, `get_table`, …) refer to that bundled server. If the session also has a separately-configured `monte-carlo-mcp` server, do **not** route to it — it may point at a different endpoint or credentials.
12
13Tiered methodology lives **in this SKILL.md** (Steps 1–4). Use the Read tool on this file (not MCP resources).
14
15## When to Use
16
17Activate when the user:
18
19- Asks about slow pipelines, jobs, or queries
20- Wants to find expensive or costly queries
21- Mentions performance regressions or degradation
22- Asks "why is this pipeline slow?" or "what's using the most compute?"
23- Wants to compare performance over time or find bottleneck tasks
24- Asks about failed or futile query patterns
25
26**Do NOT activate** when the user is:
27
28- Investigating data quality issues → use the `prevent` skill
29- Looking at storage costs → use the `storage-cost-analysis` skill
30- Creating monitors → use the `monitoring-advisor` skill
31- Just querying data or exploring table contents
32
33## Prerequisites
34
35The following MCP tools must be available via the bundled Monte Carlo MCP server (`mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__*`):
36
37**Discovery tools (Tier 1):**
38
39| Tool | Purpose |
40|------|---------|
41| `get_jobs_performance` | Find slow/failing jobs across Airflow, dbt, Databricks |
42| `get_top_slow_queries` | Find slowest query groups by total runtime |
43
44**Bridge tool:**
45
46| Tool | Purpose |
47|------|---------|
48| `get_tables_for_job` | Convert job MCONs to table MCONs |
49
50**Diagnosis tools (Tier 2):**
51
52| Tool | Purpose |
53|------|---------|
54| `get_tasks_performance` | Drill into a job's individual tasks |
55| `get_change_timeline` | Unified timeline of query changes, volume shifts, Airflow/dbt failures |
56| `get_query_rca` | Root cause analysis for failed/futile queries |
57| `get_query_latency_distribution` | Latency trend over time |
58| `get_asset_lineage` | Trace upstream/downstream impact |
59
60**Supporting tools:**
61
62| Tool | Purpose |
63|------|---------|
64| `get_warehouses` | List available warehouses |
65
66## Procedure
67
68### Step 1 — Identify the scope
69
70Determine what the user wants to investigate:
71
72- **Specific job/pipeline** — User mentions a job name or pipeline.
73- **Specific table** — User mentions a table that's slow to update.
74- **General discovery** — User wants to find what's slow.
75
76Call `get_warehouses` to list available warehouses. Match the user's context to a warehouse.
77
78> **Tier 1 start:** job/pipeline named → `get_jobs_performance`; expensive/slow queries → `get_top_slow_queries`; hour-level regression → `get_query_latency_distribution` with `bucket="1h"`; otherwise run both discovery tools, then present top findings before drilling.
79
80### Step 2 — Tier 1: Discovery
81
82If you don't have specific MCONs to investigate, start with discovery:
83
841. **Find slow jobs** — Call `get_jobs_performance` with optional `integration_type` filter (`AIRFLOW`, `DATABRICKS`, `DBT`) if the user specifies a platform.
85 - Results include: job name, average duration, trend (7-day), run count, failure rate.
86 - Look for: high `avgDuration`, negative `runDurationTrend7d`, high failure rates.
87
882. **Find expensive queries** — Call `get_top_slow_queries` with optional `warehouse_id` and `query_type` (`"read"` for SELECTs, `"write"` for INSERT/CREATE/MERGE).
89 - Results include: query hash, total runtime, average runtime, run count.
90 - Look for: queries with high total runtime or high individual execution time.
91
92Present the top findings to the user before drilling deeper. A typical investigation needs only **3–7 tool calls**.
93
94**If both discovery tools return no results:** Tell the user no performance issues were found in the current time window. Suggest broadening the scope (different warehouse, longer time range, or a different platform filter).
95
96### Step 3 — Bridge: Job to Tables
97
98After Tier 1 identifies problematic jobs, convert to table MCONs:
99
100Call `get_tables_for_job(job_mcon=..., integration_type=...)` using the `integration_type` from the job performance results.
101
102This gives you the table MCONs needed for Tier 2 investigation.
103
104### Step 4 — Tier 2: Diagnosis
105
106Drill into root causes using the MCONs from discovery or the bridge:
107
1081. **Task bottleneck** — Call `get_tasks_performance` to find which specific task in a job is the bottleneck.
109
1102. **What changed?** — Call `get_change_timeline`. This is your most powerful tool. It returns a unified timeline of:
111 - Query text changes (schema modifications, new JOINs, filter changes)
112 - Volume shifts (row count spikes/drops)
113 - Airflow task failures
114 - dbt model failures
115
116 All in one call. Look for correlations: "query changed on day X, runtime doubled on day X+1."
117
1183. **Why are queries failing?** — Call `get_query_rca` to get root cause analysis:
119 - **Failed** queries: errors, timeouts, permission issues.
120 - **Futile** queries: queries that run but produce no useful output.
121 - Patterns are pre-computed — the tool groups failures by cause.
122
1234. **Is latency degrading?** — Call `get_query_latency_distribution` to see the trend:
124 - Compare p50 vs p95 — if p95 >> p50 (>5×), the problem is outlier queries.
125 - Look for step-changes in latency (sudden increase = regression).
126 - **For step-change / regression-time-localization use cases, pass `bucket="1h"`.** The default downsamples to daily on windows ≥ 3 days, which hides hour-level steps.
127
1285. **Trace impact** — Call `get_asset_lineage` with `direction="DOWNSTREAM"` to see what's affected by a slow table, or `direction="UPSTREAM"` to find what feeds it.
129
130### Step 5 — Present findings
131
132Structure your response as:
133
1341. **Problem summary** — What's slow and by how much (with exact numbers from tools).
1352. **Root cause** — What changed or what's causing the issue.
1363. **Impact** — What downstream systems are affected.
1374. **Recommendations** — Specific actions to fix the issue.
138
139## Hard Rules
140
141These rules are non-negotiable and must be followed on every invocation:
142
1431. **Quote tool numbers exactly.** If a tool returns "1282 runs, avg 22.5s", say exactly that. Never round, estimate, or fabricate numbers.
1442. **Always compare to baselines.** Use 7-day trend data (`runDurationTrend7d`) to distinguish regressions from normal variance. Flag if trend data has less than 0.1 confidence.
1453. **Stop when you have a root cause.** 3–7 tool calls is typical. More than 10 means you're over-investigating.
1464. **Read vs write queries — never mix them.** When the user asks about "reads" or "read queries", filter with `query_type="read"`. When they ask about "writes", use `query_type="write"`.
1475. **Never expose MCONs, UUIDs, or internal identifiers** to the user. Use human-readable names.
1486. **Cross-platform awareness.** This skill works across Airflow, dbt, and Databricks. Note which platform each finding comes from.
1497. **Tool routing.** Always use the bundled server prefix `mcp__plugin_mc-agent-toolkit_monte-carlo-mcp__<tool>`. Never route to a separately-configured `monte-carlo-mcp` server.
150
151## Pitfalls
152
153- **Default latency bucketing hides hour-level steps.** `get_query_latency_distribution` downsamples to daily on windows ≥ 3 days. If you're hunting for a regression that happened at a specific hour, always pass `bucket="1h"`.
154- **Over-investigation.** Calling more than 10 tools usually means you haven't formed a hypothesis. Stop, summarize what you know, and present findings.
155- **Mixing read and write query types.** Passing no `query_type` or mixing them produces misleading "top slow" results because write queries (INSERT/MERGE) have fundamentally different runtime profiles than reads.
156- **Ignoring trend confidence.** A negative `runDurationTrend7d` with confidence < 0.1 is noise, not a regression. Always check confidence before flagging.
157- **Exposing internal IDs.** MCONs and UUIDs are implementation details. Users should see job names, table names, and query descriptions — never raw identifiers.
158- **Both discovery tools return empty.** This doesn't mean "no data" — it means no performance issues in the current window. Suggest broadening scope before concluding nothing is wrong.
159- **Assuming platform homogeneity.** A single investigation may span Airflow orchestration, dbt models, and Databricks compute. Always track which platform each finding originates from.
160
161## Verification
162
163After completing the investigation, verify your findings are actionable:
164
1651. **Numbers check** — Every metric in your summary (durations, run counts, failure rates, latency percentiles) must trace back to a specific tool call's output. No fabricated or rounded values.
1662. **Root cause linkage** — Your stated root cause must reference a specific event from `get_change_timeline` or a specific pattern from `get_query_rca`. If you can't point to one, you don't have a root cause yet.
1673. **Impact trace** — If you claim downstream impact, it must come from `get_asset_lineage` with `direction="DOWNSTREAM"`. If you claim upstream dependency, it must come from `direction="UPSTREAM"`.
1684. **Baseline comparison** — Every "slow" or "degraded" claim must include the baseline (7-day trend or p50 vs p95 comparison). A single data point is not a regression.
1695. **Tool call budget** — Confirm you used ≤ 10 tool calls. If you exceeded this, prune the investigation and present what you have.
170
171## Related Skills
172
173- **`prevent`** — Data quality issue investigation
174- **`storage-cost-analysis`** — Storage cost analysis
175- **`monitoring-advisor`** — Monitor creation and alerting configuration