Last updated: March 16, 2026

Grafana

URL: http://109.199.120.120:3000 Credentials: admin / coderz123 Grafana is the central visualization layer of the Coderz Stack. It connects to multiple data sources — Prometheus (metrics) and Loki (logs) — and provides pre-built dashboards for every component in the stack.

What It Does

  • Displays real-time and historical metrics from all services
  • Provides searchable log viewers (via Loki)
  • Fires alerts when thresholds are exceeded
  • Sends alert notifications via email

Pre-Provisioned Dashboards

All dashboards are automatically loaded when the stack starts — no manual setup needed.
DashboardDescription
Coderz Stack HomeAll-in-one overview: CPU, RAM, Disk, top Docker containers
API Traffic MonitorHigh-traffic API visibility: per-endpoint req/min, success %, 4xx/5xx, latency P95/P99, live error logs — built for 1M+ req/min
Server OverviewNode Exporter: CPU by mode, load average, RAM, disk, network, processes, FDs, TCP
Docker ContainerscAdvisor: per-container CPU, memory, network I/O
Container LogsLoki: live log stream from all Docker containers
.NET API Full StackPrometheus request metrics + PostgreSQL stats + live request log table
Prefect FlowsLoki-based: flow completions, failures, alert log, live flow logs
Alerts StatusCPU/RAM/Disk stat panels + timeseries alert history
Kubernetes Overviewk3s pods, nodes, deployments via kube-state-metrics

Alert Rules

Grafana evaluates these alert rules continuously:
AlertConditionEvaluation Period
High CPUCPU usage > 80%5 minutes
High RAMMemory usage > 85%5 minutes
High DiskDisk usage > 90%5 minutes
Container Count LowRunning containers < 62 minutes
When any alert fires, an email is sent to aboodm7med1995@gmail.com via Postfix SMTP.

Data Sources

SourceTypeURL
PrometheusPrometheushttp://prometheus:9090
LokiLokihttp://loki:3100

Adding a New Dashboard

  1. Go to Dashboards → New → New Dashboard
  2. Add panels using PromQL (for metrics) or LogQL (for logs)
  3. Save the dashboard
  4. To persist it across restarts, export as JSON and place in /opt/coderz/configs/grafana/provisioning/dashboards/

Useful PromQL Queries

# CPU usage %
100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)

# RAM usage %
(1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * 100

# Disk usage %
(1 - node_filesystem_free_bytes / node_filesystem_size_bytes) * 100

# HTTP request rate (.NET API)
rate(http_requests_received_total[1m])

# HTTP error rate
rate(http_requests_received_total{code=~"5.."}[1m])