
Grafana Has a Free Dashboard API That Most Monitoring Teams Underuse
Grafana's HTTP API lets you create dashboards, manage alerts, query data sources, and automate monitoring — all programmatically. No clicking through the UI. Authentication # Create API key in Grafana UI → Configuration → API Keys export GRAFANA_TOKEN = "your-api-key" curl -H "Authorization: Bearer $GRAFANA_TOKEN " http://localhost:3000/api/org Dashboard API # Create dashboard curl -X POST http://localhost:3000/api/dashboards/db \ -H "Authorization: Bearer $GRAFANA_TOKEN " \ -H "Content-Type: application/json" \ -d '{ "dashboard": { "title": "API Metrics", "panels": [{ "type": "timeseries", "title": "Request Rate", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}, "targets": [{ "expr": "rate(http_requests_total[5m])", "legendFormat": "{{method}} {{path}}" }] }] }, "overwrite": true }' # Search dashboards curl -H "Authorization: Bearer $GRAFANA_TOKEN " \ "http://localhost:3000/api/search?query=api" Alerting API # Create alert rule curl -X POST http://localhost:3000/api/v1/provisioning/alert
Continue reading on Dev.to DevOps
Opens in a new tab



