|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Grafana Helm Setup |
| 4 | +permalink: /docs/concepts/grafana-helm-setup |
| 5 | +--- |
| 6 | + |
| 7 | +# Grafana Helm Setup |
| 8 | + |
| 9 | +<details> |
| 10 | +<summary><h2>Introduction</h2></summary> |
| 11 | + |
| 12 | +This guide explains how to set up Grafana for monitoring Cadence workflows and services using Helm charts. Helm simplifies the deployment and management of Grafana in Kubernetes environments. Pre-configured dashboards for Cadence are available to visualize metrics effectively. |
| 13 | + |
| 14 | +</details> |
| 15 | + |
| 16 | +<details> |
| 17 | +<summary><h2>Prerequisites</h2></summary> |
| 18 | + |
| 19 | +Before proceeding, ensure the following: |
| 20 | + |
| 21 | +- Kubernetes cluster is up and running. |
| 22 | +- Helm is installed on your system. Refer to the [Helm installation guide](https://helm.sh/docs/intro/install/). |
| 23 | +- Access to the Cadence Helm charts repository. |
| 24 | + |
| 25 | +</details> |
| 26 | + |
| 27 | +<details> |
| 28 | +<summary><h2>Setup Steps</h2></summary> |
| 29 | + |
| 30 | +### Step 1: Add Cadence Helm Repository |
| 31 | + |
| 32 | +```bash |
| 33 | +helm repo add cadence-workflow https://cadenceworkflow.github.io/cadence-charts |
| 34 | +helm repo update |
| 35 | +``` |
| 36 | + |
| 37 | +### Step 2: Deploy Prometheus Operator |
| 38 | + |
| 39 | +```bash |
| 40 | +helm repo add prometheus-community https://prometheus-community.github.io/helm-charts |
| 41 | +helm install prometheus-operator prometheus-community/kube-prometheus-stack \ |
| 42 | + --namespace monitoring --create-namespace |
| 43 | +``` |
| 44 | + |
| 45 | +### Step 3: Deploy Cadence with ServiceMonitor |
| 46 | + |
| 47 | +Create a `values.yaml` file to enable ServiceMonitor for automatic metrics scraping: |
| 48 | + |
| 49 | +```yaml |
| 50 | +# Enable metrics collection |
| 51 | +metrics: |
| 52 | + enabled: true |
| 53 | + port: 9090 |
| 54 | + portName: metrics |
| 55 | + |
| 56 | + serviceMonitor: |
| 57 | + enabled: true |
| 58 | + # Replace with the namespace where Prometheus is deployed |
| 59 | + namespace: "monitoring" |
| 60 | + namespaceSelector: |
| 61 | + # Ensure this matches Prometheus's namespace |
| 62 | + matchNames: |
| 63 | + - monitoring |
| 64 | + scrapeInterval: 10s |
| 65 | + additionalLabels: |
| 66 | + # Ensure this matches Prometheus's Helm release name |
| 67 | + release: prometheus-operator |
| 68 | + annotations: {} |
| 69 | + jobLabel: "app.kubernetes.io/name" |
| 70 | + targetLabels: |
| 71 | + - app.kubernetes.io/name |
| 72 | + relabelings: [] |
| 73 | + metricRelabelings: [] |
| 74 | +``` |
| 75 | +
|
| 76 | +Deploy Cadence: |
| 77 | +```bash |
| 78 | +helm install cadence cadence-workflow/cadence \ |
| 79 | + --namespace cadence --create-namespace \ |
| 80 | + --values values.yaml |
| 81 | +``` |
| 82 | + |
| 83 | +**Note:** Update the `namespace`, `matchNames`, and `release` values to match your Prometheus deployment. |
| 84 | + |
| 85 | +### Step 4: Access Grafana |
| 86 | + |
| 87 | +Get Grafana admin password: |
| 88 | +```bash |
| 89 | +kubectl get secret --namespace monitoring prometheus-operator-grafana \ |
| 90 | + -o jsonpath="{.data.admin-password}" | base64 --decode |
| 91 | +``` |
| 92 | + |
| 93 | +Access Grafana: |
| 94 | +```bash |
| 95 | +kubectl port-forward --namespace monitoring svc/prometheus-operator-grafana 3000:80 |
| 96 | +``` |
| 97 | + |
| 98 | +Open http://localhost:3000 (admin/password from above) |
| 99 | + |
| 100 | +### Step 5: Import Cadence Dashboards |
| 101 | + |
| 102 | +1. **Download the Cadence Grafana Dashboard JSON:** |
| 103 | +```bash |
| 104 | +curl https://raw.githubusercontent.com/cadence-workflow/cadence/refs/heads/master/docker/grafana/provisioning/dashboards/cadence-server.json -o cadence-server.json |
| 105 | +``` |
| 106 | + |
| 107 | +2. **Import in Grafana:** **Dashboards** → **Import** → Upload JSON files |
| 108 | +3. **Select Prometheus** as data source when prompted |
| 109 | +4. Try the same steps for other dashboards |
| 110 | + |
| 111 | +</details> |
| 112 | + |
| 113 | +<details> |
| 114 | +<summary><h2>Customization</h2></summary> |
| 115 | + |
| 116 | +The Grafana dashboards can be customized by editing the JSON files or modifying panels directly in Grafana. Additionally, Helm values can be overridden during installation to customize Grafana settings. |
| 117 | + |
| 118 | +### Example: Override Helm Values |
| 119 | +Create a `values.yaml` file to customize Grafana settings: |
| 120 | +```yaml |
| 121 | +grafana: |
| 122 | + adminPassword: "your-password" |
| 123 | + dashboards: |
| 124 | + enabled: true |
| 125 | +``` |
| 126 | +
|
| 127 | +Install Grafana with the custom values: |
| 128 | +```bash |
| 129 | +helm install grafana cadence/grafana -n cadence-monitoring -f values.yaml |
| 130 | +``` |
| 131 | + |
| 132 | +</details> |
| 133 | + |
| 134 | +<details> |
| 135 | +<summary><h2>Additional Information</h2></summary> |
| 136 | + |
| 137 | +- [Cadence Helm Charts Repository](https://github.com/cadence-workflow/cadence-charts) |
| 138 | +- [Grafana Documentation](https://grafana.com/docs/) |
| 139 | +- [Helm Documentation](https://helm.sh/docs/) |
| 140 | + |
| 141 | +</details> |
0 commit comments