Skip to content

Commit d460fc0

Browse files
authored
feat(grafana): wire Prometheus datasource to main Grafana instance (#24)
## Summary The main Grafana CR has been login-functional but had no datasources, so the home dashboard is empty. Add a \`GrafanaDatasource\` pointing at the kube-prometheus-stack Prometheus, selected onto the main instance via the matching \`dashboards: grafana\` label (the \`status-grafana\` instance already has its own analogous datasource). Loki / Tempo / Alertmanager / Pyroscope are not installed — those datasources are out of scope here and can be added once the backends are. ## Test plan - [x] After merge: \`kubectl -n grafana get grafanadatasource grafana-prometheus\` is Synced - [x] After merge: in Grafana UI → Connections → Data sources, "Prometheus" appears as the default - [x] After merge: a panel with \`up\` query shows live data 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent f7297c9 commit d460fc0

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

workloads/grafana/datasource.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Prometheus datasource for the main Grafana instance, sourced from
3+
# kube-prometheus-stack's in-cluster Prometheus. Selected onto the main
4+
# Grafana via the matching `dashboards: grafana` label.
5+
apiVersion: grafana.integreatly.org/v1beta1
6+
kind: GrafanaDatasource
7+
metadata:
8+
name: grafana-prometheus
9+
namespace: grafana
10+
annotations:
11+
argocd.argoproj.io/sync-wave: "1"
12+
spec:
13+
instanceSelector:
14+
matchLabels:
15+
dashboards: "grafana"
16+
datasource:
17+
name: Prometheus
18+
type: prometheus
19+
access: proxy
20+
isDefault: true
21+
url: http://kube-prometheus-stack-prometheus.monitoring.svc:9090
22+
jsonData:
23+
timeInterval: 30s

workloads/grafana/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
55
- grafana.yaml
6+
- datasource.yaml
67
- status-grafana.yaml
78
- status-monitoring.yaml
89
- status-datasource.yaml

0 commit comments

Comments
 (0)