@@ -4,6 +4,7 @@ templates:
44 - templates/apiserver-configmap.yaml
55 - templates/processor-podmonitor.yaml
66 - templates/processor-configmap.yaml
7+ - templates/gc-podmonitor.yaml
78 - templates/prometheus-rule.yaml
89 - templates/grafana-dashboards-configmap.yaml
910# Required: fs file client (the default) needs a pvcName to pass template validation.
@@ -34,6 +35,15 @@ tests:
3435 value : " 30s"
3536 template : templates/apiserver-servicemonitor.yaml
3637
38+ - it : should include RHOAI monitoring label on ServiceMonitor by default
39+ set :
40+ apiserver.serviceMonitor.enabled : true
41+ asserts :
42+ - equal :
43+ path : metadata.labels["monitoring.opendatahub.io/scrape"]
44+ value : " true"
45+ template : templates/apiserver-servicemonitor.yaml
46+
3747 - it : should apply custom ServiceMonitor interval
3848 set :
3949 apiserver.serviceMonitor.enabled : true
@@ -77,6 +87,15 @@ tests:
7787 value : " 30s"
7888 template : templates/processor-podmonitor.yaml
7989
90+ - it : should include RHOAI monitoring label on PodMonitor by default
91+ set :
92+ processor.podMonitor.enabled : true
93+ asserts :
94+ - equal :
95+ path : metadata.labels["monitoring.opendatahub.io/scrape"]
96+ value : " true"
97+ template : templates/processor-podmonitor.yaml
98+
8099 - it : should not render PodMonitor when processor is disabled
81100 set :
82101 processor.enabled : false
@@ -86,6 +105,39 @@ tests:
86105 count : 0
87106 template : templates/processor-podmonitor.yaml
88107
108+ # --- GC PodMonitor ---
109+
110+ - it : should not render GC PodMonitor when disabled (default)
111+ asserts :
112+ - hasDocuments :
113+ count : 0
114+ template : templates/gc-podmonitor.yaml
115+
116+ - it : should render GC PodMonitor when enabled
117+ set :
118+ gc.podMonitor.enabled : true
119+ asserts :
120+ - isKind :
121+ of : PodMonitor
122+ template : templates/gc-podmonitor.yaml
123+ - equal :
124+ path : spec.podMetricsEndpoints[0].port
125+ value : metrics
126+ template : templates/gc-podmonitor.yaml
127+ - equal :
128+ path : spec.podMetricsEndpoints[0].interval
129+ value : " 30s"
130+ template : templates/gc-podmonitor.yaml
131+
132+ - it : should not render GC PodMonitor when gc is disabled
133+ set :
134+ gc.enabled : false
135+ gc.podMonitor.enabled : true
136+ asserts :
137+ - hasDocuments :
138+ count : 0
139+ template : templates/gc-podmonitor.yaml
140+
89141 # --- PrometheusRule ---
90142
91143 - it : should not render PrometheusRule when disabled (default)
@@ -106,7 +158,7 @@ tests:
106158 value : batch-gateway.rules
107159 template : templates/prometheus-rule.yaml
108160
109- - it : should render all four alert rules when enabled
161+ - it : should render all five alert rules when enabled
110162 set :
111163 prometheusRule.enabled : true
112164 asserts :
@@ -134,6 +186,12 @@ tests:
134186 alert : BatchGatewayWorkersSaturated
135187 any : true
136188 template : templates/prometheus-rule.yaml
189+ - contains :
190+ path : spec.groups[0].rules
191+ content :
192+ alert : BatchReconcilerErrors
193+ any : true
194+ template : templates/prometheus-rule.yaml
137195
138196 # --- PrometheusRule expr metric name guards ---
139197
@@ -177,6 +235,15 @@ tests:
177235 pattern : total_workers
178236 template : templates/prometheus-rule.yaml
179237
238+ - it : should use batch_reconciler_errors_total in ReconcilerErrors expr
239+ set :
240+ prometheusRule.enabled : true
241+ asserts :
242+ - matchRegex :
243+ path : spec.groups[0].rules[4].expr
244+ pattern : batch_reconciler_errors_total
245+ template : templates/prometheus-rule.yaml
246+
180247 - it : should not reference tenantID in any PrometheusRule expr
181248 set :
182249 prometheusRule.enabled : true
@@ -197,6 +264,10 @@ tests:
197264 path : spec.groups[0].rules[3].expr
198265 pattern : tenantID
199266 template : templates/prometheus-rule.yaml
267+ - notMatchRegex :
268+ path : spec.groups[0].rules[4].expr
269+ pattern : tenantID
270+ template : templates/prometheus-rule.yaml
200271
201272 # --- Grafana Dashboards ConfigMap ---
202273
@@ -258,6 +329,31 @@ tests:
258329 pattern : tenantID
259330 template : templates/grafana-dashboards-configmap.yaml
260331
332+ - it : should reference expected GC reconciler metric names in dashboard JSON
333+ set :
334+ grafana.dashboards.enabled : true
335+ asserts :
336+ - matchRegex :
337+ path : data["gc.json"]
338+ pattern : batch_reconciler_orphans_recovered_total
339+ template : templates/grafana-dashboards-configmap.yaml
340+ - matchRegex :
341+ path : data["gc.json"]
342+ pattern : batch_reconciler_cycle_duration_seconds_bucket
343+ template : templates/grafana-dashboards-configmap.yaml
344+ - matchRegex :
345+ path : data["gc.json"]
346+ pattern : batch_reconciler_errors_total
347+ template : templates/grafana-dashboards-configmap.yaml
348+ - matchRegex :
349+ path : data["gc.json"]
350+ pattern : batch_reconciler_cas_conflicts_total
351+ template : templates/grafana-dashboards-configmap.yaml
352+ - matchRegex :
353+ path : data["gc.json"]
354+ pattern : batch_reconciler_stale_cleanup_total
355+ template : templates/grafana-dashboards-configmap.yaml
356+
261357 - it : should reference expected apiserver metric names in dashboard JSON
262358 set :
263359 grafana.dashboards.enabled : true
0 commit comments