aiagent/skill/embedded/builtin/analyze-dashboard/SKILL.md
Help the user analyze the data health of an existing dashboard over a given time window, and produce an anomaly list with recommendations.
The core tool is get_dashboard_data: it performs data fetching and statistical pre-screening on the server side (four deterministic detections — MAD outliers, sudden changes, trends, year-over-year comparison — plus periodicity denoising), and returns layered results. Year-over-year baseline: for a window ≤24h it compares against the same period yesterday; for a longer window it compares against the previous period of the same length (the digest header states the shift amount — describe it accordingly). The detection is already done; your job is attribution, correlation, and explanation, not re-scanning point by point.
dashboard_id (injected by the frontend from /dashboards/<id>) → use it directly./dashboards/<id> link → take the id.list_dashboards(query="..."); if there are multiple candidates or no match, list them and ask the user — do not guess.get_dashboard_data(id=<id>, time_range="24h")
time_range according to user intent ("the last day" → 24h, "this week" → 7d); if the user did not specify, use the default 1h and note the analysis window in the conclusion.vars: vars={"ident":["web01"]} (the variable name follows the variable definition in get_dashboard_detail(include_config=true); if unsure, check it first).The tool returns layered results: ⚠ suspicious curves (features + sampled points) / ✓ normal summary / skipped list (including a flat-line category — curves with a constant value are counted separately; if a curve is flat but at a different level than yesterday, it goes into the suspicious section as a year-over-year anomaly, e.g. qps stuck at 0). What you should do:
14:32 CPU sudden change +312% co-occurring with 14:32 disk latency outlier → likely the same event; merge them into a single problem statement rather than listing them as two.query_prometheus to narrow the time window and inspect details (e.g. ±15 minutes around the sudden change, with a smaller step), or query a related metric to validate a hypothesis. Drill down into at most 2-3 of the most critical ones; do not query every suspicious curve.## <dashboard name> Health Analysis (window 24h)
**Overall conclusion**: one sentence (e.g.: found 1 suspected disk performance event affecting the etcd-2 node; all other metrics normal)
### Anomalies (by severity)
1. **etcd-2 disk performance degradation (starting at 14:30)**
- Evidence: WAL fsync latency 4ms→89ms (sudden change +312%@14:30, no such phenomenon in the year-over-year window); CPU spiked to 96% at the same moment
- Impact: write latency will be driven up directly
2. ...
### Correlation analysis
(correlation inference of multiple metrics over time)
### Recommendations
- Actionable next steps (check the disk of the host where etcd-2 resides / iostat / whether there is a snapshot job...)
panel_ids to re-call key panels in batches, then merge the conclusions at the end.