Skip to content

Dashboard Configuration

SLOzy ships with Prometheus and Grafana for observability. This page covers how to configure, provision, and customise dashboards.

Grafana Provisioning

The docker-compose.yml mounts provisioning directories for automatic dashboard loading:

yaml
volumes:
  - ./grafana/provisioning:/etc/grafana/provisioning
  - ./grafana/dashboards:/var/lib/grafana/dashboards

Grafana loads datasources and dashboards from these mounted paths at startup. To add a new dashboard, place a JSON file in grafana/dashboards/ and restart Grafana.

Datasource Provisioning

Create grafana/provisioning/datasources/prometheus.yaml:

yaml
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true

Dashboard Provisioning

Create grafana/provisioning/dashboards/slozy.yaml:

yaml
apiVersion: 1
providers:
  - name: SLOzy
    type: file
    options:
      path: /var/lib/grafana/dashboards

1. SLO Burn-Rate Overview

Track error budget consumption and burn rate for all SLOs.

PanelQueryDescription
SLO Statusslo_statusCurrent status per SLO (OK / warning / critical)
Error Budget1 - (slo_error_budget_consumed)Remaining error budget percentage
Burn Raterate(slo_error_budget_consumed[5m])Current rate of budget consumption
Time to Exhaustionslo_error_budget_remaining / rate(slo_error_budget_consumed[1h])Hours until budget depleted

2. Application Performance

Monitor request rate, latency, and error rate for the SLOzy API.

PanelQueryDescription
Request Raterate(http_requests_total[5m])Requests per second
Latency P95histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))95th percentile latency
Latency P99histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))99th percentile latency
Error Raterate(http_requests_total{status=~"5.."}[5m]) / rate(http_requests_total[5m])Percentage of 5xx responses

3. Database

PanelQueryDescription
Active Connectionspg_stat_database_numbackendsCurrent connections to slozy_db
Cache Hit Ratiorate(pg_stat_database_blks_hit[5m]) / (rate(pg_stat_database_blks_hit[5m]) + rate(pg_stat_database_blks_read[5m]))Buffer cache efficiency

4. Host & Containers (pre-installed)

A comprehensive infrastructure dashboard showing host and container metrics from node_exporter and cAdvisor. Located at grafana/dashboards/host-overview.json.

PanelQueryDescription
CPU Usage100 - avg(rate(node_cpu_seconds_total{mode="idle"}[$__rate_interval])) * 100Host CPU utilisation gauge
Memory Usage(1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * 100Host RAM utilisation gauge
Disk Usage(1 - node_filesystem_free_bytes{mountpoint="/"} / ...) * 100Root partition usage gauge
Uptimetime() - node_boot_time_secondsHost uptime
Container CPUsum(rate(container_cpu_usage_seconds_total{...} [$__rate_interval])) by (container_label_com_docker_compose_service)Per-container CPU
Container Memorysum(container_memory_usage_bytes{...}) by (container_label_com_docker_compose_service)Per-container memory
Container Networksum(rate(container_network_receive_bytes_total{...} [$__rate_interval])) by (container_label_com_docker_compose_service)Per-container network traffic

Alerting from Grafana

Grafana can send alerts to Slack, email, Telegram, or PagerDuty. Configure notification channels in:

  • UI: Configuration > Notification Channels
  • Provisioning: grafana/provisioning/notifiers/

Example Slack notifier:

yaml
apiVersion: 1
notifiers:
  - name: Slack
    type: slack
    uid: slack-notifier
    settings:
      url: https://hooks.slack.com/services/YOUR/WEBHOOK/URL

Access

  • Development: Grafana runs at http://localhost:3001 (default credentials admin / admin)
  • Production: Expose Grafana behind Nginx with TLS and authentication. Consider using Grafana's built-in OAuth or LDAP integration.

The SLOzy application itself does not serve dashboards — all visualisation is done through Grafana using Prometheus as the data source. To customise the dashboards, edit the JSON files in grafana/dashboards/ and redeploy.