Agent skill
grafana
Query Grafana dashboards, data sources, alerts, and annotations via the REST API.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/grafana
Metadata
Additional technical details for this skill
- thinkfleetbot
-
{ "emoji": "\ud83d\udcc8", "requires": { "env": [ "GRAFANA_URL", "GRAFANA_TOKEN" ], "bins": [ "curl", "jq" ] } }
SKILL.md
Grafana
Query dashboards, alerts, and data sources.
Environment Variables
GRAFANA_URL- Grafana instance URL (e.g.https://grafana.example.com)GRAFANA_TOKEN- API key or service account token
List dashboards
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/search?type=dash-db&limit=20" | jq '.[] | {uid, title, url}'
Get dashboard
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/dashboards/uid/my-dashboard-uid" | jq '{title: .dashboard.title, panels: [.dashboard.panels[].title], tags: .meta.tags}'
List data sources
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/datasources" | jq '.[] | {id, name, type, url}'
List alert rules
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/v1/provisioning/alert-rules" | jq '.[] | {uid, title, condition, for: .for}'
List firing alerts
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/alertmanager/grafana/api/v2/alerts?active=true" | jq '.[] | {labels: .labels, status: .status.state, startsAt}'
Query Prometheus data source
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/datasources/proxy/1/api/v1/query" \
--data-urlencode "query=up{job='my-service'}" | jq '.data.result[] | {metric: .metric, value: .value[1]}'
Query range (Prometheus)
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"$GRAFANA_URL/api/datasources/proxy/1/api/v1/query_range" \
--data-urlencode "query=rate(http_requests_total{job='my-service'}[5m])" \
--data-urlencode "start=$(date -d '1 hour ago' +%s)" \
--data-urlencode "end=$(date +%s)" \
--data-urlencode "step=60" | jq '.data.result[0].values[-5:]'
Create annotation
curl -s -X POST -H "Authorization: Bearer $GRAFANA_TOKEN" \
-H "Content-Type: application/json" \
"$GRAFANA_URL/api/annotations" \
-d '{"text": "Deployment v1.2.3", "tags": ["deploy","prod"], "time": '$(date +%s000)'}' | jq '{id, message}'
Silence alert
curl -s -X POST -H "Authorization: Bearer $GRAFANA_TOKEN" \
-H "Content-Type: application/json" \
"$GRAFANA_URL/api/alertmanager/grafana/api/v2/silences" \
-d '{
"matchers": [{"name": "alertname", "value": "HighCPU", "isRegex": false}],
"startsAt": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'",
"endsAt": "'$(date -u -d '+1 hour' +%Y-%m-%dT%H:%M:%SZ)'",
"comment": "Silenced by ThinkFleetBot",
"createdBy": "thinkfleetbot"
}' | jq '{silenceID}'
Notes
- Data source proxy URLs use the data source ID (get from list data sources).
- Grafana Cloud uses
https://your-stack.grafana.net. - Confirm before silencing alerts or creating annotations.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?