Why Grafana
Grafana is the visualization standard. Connect to Prometheus, InfluxDB, Elasticsearch, PostgreSQL, MySQL, Loki — 150+ data sources. Build dashboards that your entire team can use.
Install
# Docker
docker run -d -p 3000:3000 grafana/grafana-oss
# Helm on K8s
helm install grafana grafana/grafana -n monitoring
Grafana API
# Create a dashboard
curl -X POST http://localhost:3000/api/dashboards/db \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"dashboard": {"title": "My Dashboard", "panels": []}, "overwrite": false}'
# List dashboards
curl http://localhost:3000/api/search?type=dash-db \
-H 'Authorization: Bearer YOUR_API_KEY'
# Export dashboard
curl http://localhost:3000/api/dashboards/uid/DASHBOARD_UID \
-H 'Authorization: Bearer YOUR_API_KEY'
Dashboard as Code (Grafonnet)
local grafana = import 'grafonnet/grafana.libsonnet';
local dashboard = grafana.dashboard;
local prometheus = grafana.prometheus;
local graph = grafana.graphPanel;
dashboard.new('My Service')
.addPanel(
graph.new('Request Rate')
.addTarget(
prometheus.target('rate(http_requests_total[5m])', legendFormat='{{method}}')
),
gridPos={h: 8, w: 12, x: 0, y: 0}
)
Alerting
apiVersion: 1
contactPoints:
- orgId: 1
name: slack-alerts
receivers:
- uid: slack-1
type: slack
settings:
url: https://hooks.slack.com/services/xxx
alerts:
- title: High Error Rate
condition: B
data:
- refId: A
queryType: range
datasourceUid: prometheus
model:
expr: sum(rate(http_requests_total{status=~"5.."}[5m]))
Key Features
- 150+ data sources — Prometheus, Loki, Tempo, Postgres, MySQL, Elasticsearch
- Alerting — unified alerting across all sources
- Dashboards as Code — Terraform provider, Grafonnet, JSON
- Annotations — mark deployments, incidents on graphs
- Variables — dynamic, templated dashboards
- AGPL v3 — fully open source
Resources
Need to extract dashboard configs, metric data, or monitoring setups? Check out my Apify tools or email spinov001@gmail.com for custom solutions.
Top comments (0)