fabric-monitoringlisted
Install: claude install-skill wardawgmalvicious/claude-config
# Monitoring & diagnostics
## Query Labels
```sql
SELECT ... FROM ...
OPTION (LABEL = 'PROJECT_Module_Description');
```
Labels appear in `queryinsights.exec_requests_history.label`. Use for tracking, filtering, and performance analysis.
## Query Insights (30-day retention)
| View | Purpose |
|---|---|
| `queryinsights.exec_requests_history` | Every completed query: status, duration, CPU, data scanned |
| `queryinsights.exec_sessions_history` | Session history: login info, times |
| `queryinsights.long_running_queries` | Aggregated: median vs last-run time |
| `queryinsights.frequently_run_queries` | Run counts, execution times for recurring patterns |
**Gotcha**: Data appears with up to 15 minutes delay. After creating a new warehouse, views may return "Invalid object name" — wait ~2 minutes.
## Top Expensive Queries
```sql
SELECT TOP 10
distributed_statement_id, query_hash, label,
total_elapsed_time_ms, allocated_cpu_time_ms,
data_scanned_remote_storage_mb, result_cache_hit
FROM queryinsights.exec_requests_history
ORDER BY allocated_cpu_time_ms DESC;
```
Aggregate by `query_hash` over the last 7 days to find recurring expensive patterns.
## DMVs (Live State)
| DMV | Shows | Min Role |
|---|---|---|
| `sys.dm_exec_connections` | Active connections (session_id, client_address) | Admin only |
| `sys.dm_exec_sessions` | Authenticated sessions (login_name, login_time, status) | All roles (own sessions) |
| `sys.dm_exec_requests` | Active requests (command,