Grafana Setup Example
Example setup for monitoring Wisp.place with Grafana Cloud.
1. Create Grafana Cloud Account
Section titled “1. Create Grafana Cloud Account”Sign up at grafana.com for a free tier account.
2. Get Credentials
Section titled “2. Get Credentials”Navigate to your stack and find:
Loki (Connections → Loki → Details):
- Push endpoint:
https://logs-prod-XXX.grafana.net - Create API token with write permissions
Prometheus (Connections → Prometheus → Details):
- Remote Write endpoint:
https://prometheus-prod-XXX.grafana.net/api/prom - Create API token with write permissions
3. Configure Wisp.place
Section titled “3. Configure Wisp.place”Add to your .env:
GRAFANA_LOKI_URL=https://logs-prod-XXX.grafana.netGRAFANA_LOKI_TOKEN=glc_eyJ...
GRAFANA_PROMETHEUS_URL=https://prometheus-prod-XXX.grafana.net/api/promGRAFANA_PROMETHEUS_TOKEN=glc_eyJ...4. Create Dashboard
Section titled “4. Create Dashboard”Import this dashboard JSON or build your own:
{ "panels": [ { "title": "Request Rate", "targets": [{ "expr": "sum(rate(http_requests_total[1m])) by (service)" }] }, { "title": "P95 Latency", "targets": [{ "expr": "histogram_quantile(0.95, rate(http_request_duration_ms_bucket[5m]))" }] }, { "title": "Error Rate", "targets": [{ "expr": "sum(rate(errors_total[5m])) / sum(rate(http_requests_total[5m]))" }] } ]}5. Set Alerts
Section titled “5. Set Alerts”Example alert for high error rate:
alert: HighErrorRateexpr: | sum(rate(errors_total[5m])) by (service) / sum(rate(http_requests_total[5m])) by (service) > 0.05for: 5mannotations: summary: "High error rate in {{ $labels.service }}"Verify Data Flow
Section titled “Verify Data Flow”Check Grafana Explore:
- Loki:
{job="main-app"} | json - Prometheus:
http_requests_total
Data should appear within 30 seconds of service startup.