Skip to content

Grafana dashboards for OpenCloud PLG monitoring stack

License

Notifications You must be signed in to change notification settings

michaelstingl/opencloud-plg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenCloud PLG Dashboards

Grafana dashboards for monitoring OpenCloud with the PLG stack (Prometheus + Loki + Grafana).

Dashboards

OpenCloud Dashboards

Dashboard UID Datasource Description Docs
Overview opencloud-overview Prometheus Quick health check (start here) πŸ“–
Logs opencloud-logs Loki Service/Component/Level filter πŸ“–
Proxy opencloud-proxy Loki HTTP access logs, traffic analysis πŸ“–
Uploads opencloud-uploads Prometheus File uploads, antivirus, processing πŸ“–
Requests opencloud-requests Prometheus Performance analysis, latency πŸ“–
User Activity opencloud-user-activity Loki Authentication, audit trail, user logs πŸ“–
Activitylog Debug activitylog-debug Loki Event debugging (for upstream issues) πŸ“–

External Dashboards

Downloaded from Grafana.com during deployment:

Dashboard UID Source Description Docs
Node Exporter Full node-exporter-full #1860 Linux server metrics πŸ“–
Prometheus Stats prometheus-stats #3662 Prometheus self-monitoring πŸ“–

Dashboard Navigation

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  OpenCloud Overview β”‚ ← Start here
                    β”‚     (Prometheus)    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β”‚                   β”‚                   β”‚
           β–Ό                   β–Ό                   β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  Requests   β”‚     β”‚   Uploads   β”‚     β”‚    Logs     β”‚
    β”‚ (Prometheus)β”‚     β”‚ (Prometheus)β”‚     β”‚   (Loki)    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚
                               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                               β”‚                   β”‚                   β”‚
                               β–Ό                   β–Ό                   β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚    Proxy    β”‚     β”‚ Activitylog β”‚     β”‚  (filter by β”‚
                        β”‚   (Loki)    β”‚     β”‚   (Loki)    β”‚     β”‚  component) β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Structure

src/                                    # Dashboard source (TypeScript)
β”œβ”€β”€ shared.ts                           # Datasources, query helpers, thresholds
β”œβ”€β”€ activitylog.ts                      # Activitylog Debug dashboard
β”œβ”€β”€ opencloud-overview.ts               # Overview dashboard
β”œβ”€β”€ opencloud-logs.ts                   # Logs dashboard
β”œβ”€β”€ opencloud-proxy.ts                  # Proxy dashboard
β”œβ”€β”€ opencloud-uploads.ts                # Uploads dashboard
β”œβ”€β”€ opencloud-requests.ts               # Requests dashboard
└── opencloud-user-activity.ts          # User Activity dashboard
docs/
└── dashboards/                         # Dashboard documentation
    β”œβ”€β”€ opencloud-overview.md
    β”œβ”€β”€ opencloud-logs.md
    β”œβ”€β”€ opencloud-proxy.md
    β”œβ”€β”€ opencloud-uploads.md
    β”œβ”€β”€ opencloud-requests.md
    β”œβ”€β”€ opencloud-user-activity.md
    β”œβ”€β”€ activitylog.md
    β”œβ”€β”€ node-exporter.md                # Docs for external dashboard
    └── prometheus-stats.md             # Docs for external dashboard
grafana/
└── provisioning/
    β”œβ”€β”€ dashboards/
    β”‚   β”œβ”€β”€ dashboards.yml              # Provisioning config
    β”‚   └── *.json                      # Generated by `bun run build` (gitignored)
    └── datasources/
        └── datasources.yml             # Prometheus + Loki

Panel ID Convention

Panel IDs follow a row-based numbering scheme:

Element IDs Example
Row panels 100, 200, 300... Row 200 = second section
Panels in row +10, +20, +30... Panel 230 = 3rd panel in Row 200
No rows (Overview) 10, 20, 30... Flat structure

Benefits: Clear hierarchy, room for growth (insert 115 between 110/120), easy debugging.

Development

Dashboards are written in TypeScript using the Grafana Foundation SDK. Each src/*.ts file defines a dashboard with typed builders and generates JSON via console.log(JSON.stringify(dashboard.build())). The generated JSON is not committed β€” it is built during deployment and in CI.

Grafana Foundation SDK

Resource Link
Documentation grafana.com/docs/.../foundation-sdk
API Reference grafana.github.io/grafana-foundation-sdk
GitHub grafana/grafana-foundation-sdk
npm @grafana/grafana-foundation-sdk
SDK Version ~11.6.0-cogv0.0.x (matches Grafana 11.6)

Key patterns used:

Builder Import Used for
DashboardBuilder dashboard Dashboard metadata, variables, rows
PanelBuilder as StatBuilder stat Single-value stat panels
PanelBuilder as TimeseriesBuilder timeseries Time series charts
PanelBuilder as GaugeBuilder gauge Gauge panels
PanelBuilder as LogsBuilder logs Log stream panels
PanelBuilder as PiechartBuilder piechart Pie charts
PanelBuilder as TableBuilder table Table panels
PanelBuilder as BarGaugeBuilder bargauge Bar gauge panels
PanelBuilder as HeatmapBuilder heatmap Heatmap panels
DataqueryBuilder prometheus, loki Query definitions

src/shared.ts provides reusable helpers: datasource refs, query factories (promQuery, lokiQuery), threshold factories (greenYellowRed, etc.), and override helpers (colorOverride, regexpColorOverride).

Prerequisites (local development only)

  • Bun runtime (optional β€” CI and deployment install Bun automatically)

Build

bun install
bun run build        # Build all dashboards
bun run typecheck    # Type check only

Individual dashboards:

bun run build:opencloud-overview
bun run build:opencloud-logs
# etc.

Workflow

  1. Edit TypeScript source in src/
  2. Commit and push (only TypeScript, JSON is gitignored)
  3. CI validates (typecheck + build)
  4. Deployment builds JSON on the server with Bun

CI

The validate-dashboards.yml workflow runs on push/PR to main when src/, package.json, or tsconfig.json change:

  1. Type check β€” bun run typecheck (catches type errors, wrong builder methods)
  2. Build β€” bun run build (verifies all 7 dashboards generate valid JSON)

Deployment

A deployment workflow clones this repo, runs bun install --frozen-lockfile && bun run build, and copies the generated JSON to Grafana's provisioning directory.

Usage

These dashboards are designed for use with:

  • OpenCloud metrics (Prometheus)
  • OpenCloud logs (Loki via Grafana Alloy)

Requirements

  • Grafana 10.x or 11.x
  • Prometheus datasource (UID: prometheus)
  • Loki datasource (UID: loki)

Installation

bun install && bun run build

Then copy grafana/provisioning/ to your Grafana provisioning directory. Or import individual JSON files via Grafana UI β†’ Dashboards β†’ Import.

External Dashboards

External dashboards (Node Exporter, Prometheus Stats) are downloaded from Grafana.com during deployment and processed to set stable UIDs, replace datasource variables, and adapt label names for Alloy.

Related

License

MIT

About

Grafana dashboards for OpenCloud PLG monitoring stack

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •