Skip to content

Commit 3742f66

Browse files
fix grafana setup + new dashboards
Signed-off-by: Rahul Shetty <rashetty@redhat.com>
1 parent 2bf8d2f commit 3742f66

20 files changed

Lines changed: 16605 additions & 530 deletions

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,17 @@ deploy-observability: ## Deploy observability (OTel + OpenShift Prometheus)
286286

287287
add-grafana: ## Add Grafana on top of observability stack
288288
@echo "$(COLOR_BLUE)$(COLOR_RESET) Adding Grafana..."
289+
@kubectl apply -f components/manifests/observability/overlays/with-grafana/grafana-pvc.yaml
289290
@kubectl apply -k components/manifests/observability/overlays/with-grafana/
290291
@echo "$(COLOR_GREEN)$(COLOR_RESET) Grafana deployed"
291292
@echo " Create route: oc create route edge grafana --service=grafana -n $(NAMESPACE)"
292293

293-
clean-observability: ## Remove observability components
294+
clean-observability: ## Remove observability components (preserves Grafana PVC)
294295
@echo "$(COLOR_BLUE)$(COLOR_RESET) Removing observability..."
295296
@kubectl delete -k components/manifests/observability/overlays/with-grafana/ 2>/dev/null || true
296297
@kubectl delete -k components/manifests/observability/ 2>/dev/null || true
297298
@echo "$(COLOR_GREEN)$(COLOR_RESET) Observability removed"
299+
@echo " To also delete Grafana data: kubectl delete pvc grafana-storage -n $(NAMESPACE)"
298300

299301
grafana-dashboard: ## Open Grafana (create route first)
300302
@echo "$(COLOR_BLUE)$(COLOR_RESET) Opening Grafana..."

components/manifests/observability/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ Open **OpenShift Console → Observe → Metrics** and query:
4040
If you want custom dashboards:
4141

4242
```bash
43-
# Add Grafana overlay
43+
make add-grafana
44+
45+
# Or manually
46+
kubectl apply -f components/manifests/observability/overlays/with-grafana/grafana-pvc.yaml
4447
kubectl apply -k components/manifests/observability/overlays/with-grafana/
4548
```
4649

47-
**Adds**: Grafana (additional 128MB) - still uses OpenShift Prometheus
50+
**Adds**: Grafana (additional 128MB) with pre-provisioned dashboards - still uses OpenShift Prometheus
4851

4952
**Access Grafana**:
5053
```bash
@@ -53,10 +56,10 @@ oc create route edge grafana --service=grafana -n ambient-code
5356

5457
# Get URL
5558
oc get route grafana -n ambient-code -o jsonpath='{.spec.host}'
56-
# Login: admin/admin
59+
# Login: admin/admin (change on first login)
5760
```
5861

59-
**Import dashboard**: Upload `dashboards/ambient-operator-dashboard.json` in Grafana UI
62+
**Dashboards** are provisioned automatically from `overlays/with-grafana/dashboards/`. See [dashboards/README.md](./overlays/with-grafana/dashboards/README.md) for how to add new ones.
6063

6164
---
6265

@@ -185,6 +188,6 @@ EOF
185188
## Cleanup
186189

187190
```bash
188-
kubectl delete -k components/manifests/observability/overlays/with-grafana/ # If Grafana deployed
189-
kubectl delete -k components/manifests/observability/
191+
make clean-observability # Removes stack but preserves Grafana PVC
192+
kubectl delete pvc grafana-storage -n ambient-code # Also delete Grafana data
190193
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: ambient-code
5+
6+
resources:
7+
- otel-collector.yaml
8+
- servicemonitor.yaml

components/manifests/observability/otel-collector.yaml renamed to components/manifests/observability/base/otel-collector.yaml

File renamed without changes.

components/manifests/observability/servicemonitor.yaml renamed to components/manifests/observability/base/servicemonitor.yaml

File renamed without changes.

0 commit comments

Comments
 (0)