Skip to content

About

Perses DAC with Gitops Workflow Example

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Perses dashboard-as-code (GitOps example)

Author Prometheus dashboards in Go, validate PromQL at build time, generate PersesDashboard CRs, and deploy with Argo CD. This demo focuses on the Prometheus plugin; Perses also supports other datasources. The YAML under manifests/dashboards/ is the delivery artifact source of truth is dashboards/.

  1. Author in Go (dashboards/) with the Perses Go SDK and promql-builder import reusable panels from community-mixins and extend them for your environment
  2. Validate structural PromQL checks at build time (promqlbuilder.Validate)
  3. Render PersesDashboard CRs (make render-dashboards)
  4. Commit manifests under manifests/dashboards/
  5. Deploy with Argo CD (or kubectl apply) → perses-operator reconciles CRs to Perses

Quick start

# After changing dashboards/ (Go 1.26+)
make validate-dashboards
make render-dashboards

# kind + cert-manager, operator, minimal kube-prometheus, Perses (perses-dev)
make setup-prerequisites

# Argo CD → sync manifests/dashboards
make setup-argocd

# Tear down stack (or delete the kind cluster)
make cleanup

Non-interactive:

YES=true CLUSTER_NAME=perses-demo make setup-prerequisites
YES=true REPO_URL=https://github.com/<you>/perses-gitops-workflow.git make setup-argocd
YES=true CLUSTER_NAME=perses-demo DELETE_KIND_CLUSTER=true make cleanup

Deploy

# Direct apply (no Argo CD)
kubectl apply -f manifests/dashboards/

# Or GitOps
make setup-argocd

Perses UI: kubectl -n perses-dev port-forward svc/perses-sample 8080:8080 → http://localhost:8080

The Argo CD setup here is for demo purposes, for production, follow the Argo CD documentation. See deploy/argocd/README.md for UI, polling details, and troubleshooting.

Argo CD: Applications list

Argo CD Applications list — perses-dashboards Healthy / Synced

Argo CD: synced dashboard resources

Argo CD synced dashboard resources

Perses UI: first sync (Node Exporter / Overview)

Perses UI: Node Exporter / Overview after first sync

Argo CD: synced new dashboard

Argo CD synced new dashboard resource

Perses UI: second sync (Overview + Health)

Perses UI — Overview + Prometheus Operator / Health after second sync

Node Exporter / Overview

Community-mixins CPU/Memory (kube-prometheus job="node-exporter" matchers) + custom Filesystem panel:

Node Exporter / Overview dashboard in Perses

Prometheus Operator / Health

From-scratch dashboard with $job / $namespace (local PromQL helpers):

Prometheus Operator / Health dashboard in Perses

Optional: exercise Health panels

kubectl apply -f hack/prometheus-operator-demo-load.yaml

Generates reconcile / trigger / error traffic for the Health dashboard (assumes kube-prometheus-stack in monitoring). Details and cleanup are in the file header.

CI

make render-dashboards (runs validate-dashboards first) → fail if validation fails or manifests/dashboards/ drifts.

Optional: semantic validation with metrics-usage

For Day-2 auditing of metric names and labels against a live Prometheus, see docs/metrics-usage.md. Use a CronJob for scheduled drift checks or a one-off Job for local/CI validation.

Related

License

MIT — see LICENSE.

About

Perses DAC with Gitops Workflow Example

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages