ML AI
Grafana LabsOfficialPublished by Grafana Labs
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a comprehensive guide to enabling and configuring AI and machine learning capabilities within the Grafana Cloud ecosystem. It covers the setup of Dynamic Alerting for anomaly detection, the Sift automated root-cause analysis engine, the Grafana Assistant for natural language interactions, and the LLM plugin for connecting external AI providers. The documentation details how to leverage these tools to reduce manual monitoring overhead, automate incident response, and simplify complex data exploration tasks.
What it does
- Configures Dynamic Alerting using Prophet and DBSCAN algorithms for anomaly detection without static thresholds.
- Enables Sift for automated root-cause analysis across eight distinct diagnostic categories.
- Integrates Grafana Assistant to translate natural language into PromQL, LogQL, or TraceQL queries.
- Provides a managed LLM proxy to connect providers like OpenAI, Anthropic, and Ollama to Grafana panels.
- Utilizes Knowledge Graph and RCA Workbench to visualize entity relationships and blast radiuses.
- Supports automated dashboard generation and incident investigation workflows.
When to use it
- When you need to move beyond static alert thresholds to seasonality-aware or outlier-based alerting.
- When you want to accelerate incident response through automated root-cause analysis.
- When users require natural language interfaces to query metrics, logs, or traces.
- When you need to centralize LLM access for various Grafana plugins and panel enhancements.
- When troubleshooting complex service dependencies and resource contention issues.
Advantages
- Reduces alert fatigue by using machine learning to identify true anomalies.
- Accelerates mean time to resolution (MTTR) with automated incident investigation.
- Lowers the barrier to entry for complex query languages via natural language processing.
- Provides a unified interface for managing multiple AI and LLM integrations.
- Offers deep visibility into infrastructure relationships through automated knowledge graphs.
Usage examples
- “Set up an alert that fires when CPU usage deviates from its normal weekly pattern.”
- The agent guides you to configure a Dynamic Alerting job using the Prophet algorithm to forecast expected metric behavior.
- “Find the root cause of the latency spike in the checkout service.”
- The agent triggers a Sift investigation, running eight automated analyses to correlate logs, deployments, and resource contention.
- “Explain what this PromQL query is doing.”
- The Grafana Assistant analyzes the query and provides a plain-English explanation of its logic and purpose.
- “Connect Claude to my Grafana instance.”
- The agent provides the configuration steps to provision the LLM plugin with your Anthropic API credentials.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/grafana/ml-ai/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip ml-ai.zip -d .agents/skills
Documentation by Grafana Labs
Grafana Cloud AI & ML
Docs: https://grafana.com/docs/grafana-cloud/alerting-and-irm/machine-learning/
ML alerting + automated RCA + LLM-powered Assistant in one Grafana Cloud stack.
Prerequisites
Grafana Cloud stack (Pro / Advanced — most features GA, some in preview)
API token with
plugins:writefor ML / Sift / LLM-plugin endpointsFor Dynamic Alerting: at least 14 days (ideally 90d) of history for the metric you want to forecast
Common Workflows
1. Forecasting alert with Dynamic Alerting
# 1. Create forecast job (Prophet — learns daily/weekly seasonality)
curl -X POST https://<stack>.grafana.net/api/plugins/grafana-ml-app/resources/ml/v1/forecast \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "cpu-forecast",
"metric": "avg(rate(node_cpu_seconds_total{mode=\"user\"}[5m]))",
"datasourceId": 1,
"interval": 300,
"trainingWindow": "90d",
"forecastWindow": "7d",
"algorithm": { "name": "prophet", "config": {} }
}'
# 2. Verify job is producing the predicted-value metric (may take a few minutes).
# <datasourceId> must match the datasourceId used above (find it via
# GET /api/datasources), or run the query from Explore instead.
curl -s -H "Authorization: Bearer <token>" \
'https://<stack>.grafana.net/api/datasources/proxy/<datasourceId>/api/v1/query?query=ml_forecast_upper{job="cpu-forecast"}' \
| jq '.data.result | length'
# Expect > 0
# 3. Add an alert that fires when actual exceeds the upper bound
# expr: avg(rate(node_cpu_seconds_total{mode="user"}[5m]))
# > ml_forecast_upper{job="cpu-forecast"} * 1.12. Outlier alert — one service deviates from peers
# 1. Create outlier job (DBSCAN — groups peers, flags the odd one)
curl -X POST https://<stack>.grafana.net/api/plugins/grafana-ml-app/resources/ml/v1/outlier \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{
"name": "service-error-outliers",
"metric": "sum(rate(http_requests_total{status=~\"5..\"}[5m])) by (service)",
"datasourceId": 1,
"interval": 300,
"algorithm": { "name": "dbscan", "sensitivity": 0.5, "config": { "epsilon": 0.5 } }
}'
# 2. Verify the score metric exists (<datasourceId> must match the
# datasourceId used above, or run the query from Explore instead)
curl -s -H "Authorization: Bearer <token>" \
'https://<stack>.grafana.net/api/datasources/proxy/<datasourceId>/api/v1/query?query=ml_outlier_score{job="service-error-outliers"}' \
| jq '.data.result | length'
# 3. Alert when ml_outlier_score{job="service-error-outliers"} > 0.8 for 5m3. Run a Sift investigation
# 1. Trigger from API (or from Explore / Incident / OnCall)
curl -X POST https://<stack>.grafana.net/api/plugins/grafana-sift-app/resources/sift/v1/investigations \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{ "name":"checkout-spike","start":"2024-02-01T10:00:00Z","end":"2024-02-01T10:30:00Z",
"filters":{"service":"checkout","namespace":"production"} }'
# 2. The response includes an investigation ID — open it in the UI:
# https://<stack>.grafana.net/a/grafana-sift-app/investigations/<id>
# 3. Verify analyses ran — each of the 8 checks shows ✔ or ✖ with linked evidence.See references/sift.md for the full 8-analysis table.
4. Wire up the LLM Plugin
# 1. Provision (provisioning/plugins/llm.yaml — see references/llm-and-graph.md)
apiVersion: 1
apps:
- type: grafana-llm-app
jsonData: { openAIUrl: https://api.openai.com, openAIModel: gpt-4o }
secureJsonData: { openAIKey: sk-... }# 2. Restart Grafana, then verify the health endpoint reports the configured provider
curl -s -H "Authorization: Bearer <token>" \
https://<stack>.grafana.net/api/plugins/grafana-llm-app/health | jq
# Expect: {"status":"ok", ...}
# 3. Verify in a panel — open any panel, click the Assistant icon, ask "what does this query do?"See references/llm-and-graph.md for Assistant capabilities, Knowledge Graph search syntax, and Adaptive Metrics recommendations.
Resources
Files
- ATTRIBUTION.mdAdded by AutoGineer831 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md5.3 KiB
- references/llm-and-graph.md2.4 KiB
- references/sift.md1.4 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs network access
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Grafana Labs
- Publisher
- Grafana Labs (Official)
- Source
- grafana/skills · skills/grafana-cloud/ml-ai · commit 8fb72a5
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Grafana Labs.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download ml-ai.zip