@@ -93,7 +93,6 @@ Test Metric Existence For "Rhods_Aggregate_Availability" On ODS Prometheus
93
93
@{list_values } = Create List 1 0
94
94
Should Contain ${list_values } ${resp.json()["data"]["result"][0]["value"][-1] }
95
95
96
-
97
96
Test Targets Are Available And Up In RHOAI Prometheus
98
97
[Documentation] Verifies the expected targets in Prometheus are available and up running
99
98
[Tags] Sanity
@@ -123,6 +122,48 @@ Test Targets Are Available And Up In RHOAI Prometheus
123
122
List Should Contain Value ${targets } user_facing_endpoints_status_rhods_dashboard
124
123
List Should Contain Value ${targets } user_facing_endpoints_status_workbenches
125
124
125
+ Test RHOAI Dashboard Metrics By Code Are Defined
126
+ [Documentation] Verifies the RHOAI Dashboard Metrics By Code Are Defined and show accurate values
127
+ ... (2xx and 5xx codes)
128
+ [Tags] Sanity
129
+ ... Tier1
130
+ ... ODS-195
131
+ ... RHOAIENG-13261
132
+ ... Monitoring
133
+ Skip If RHODS Is Self-Managed
134
+ ${response_by_code } = Prometheus.Run Query
135
+ ... pm_url=${RHODS_PROMETHEUS_URL }
136
+ ... pm_token=${RHODS_PROMETHEUS_TOKEN }
137
+ ... pm_query=sum(haproxy_backend_http_responses_total {route='rhods-dashboard'}) by(code)
138
+ ${response_5xx } = Prometheus.Run Query
139
+ ... pm_url=${RHODS_PROMETHEUS_URL }
140
+ ... pm_token=${RHODS_PROMETHEUS_TOKEN }
141
+ ... pm_query=sum(haproxy_backend_http_responses_total{route='rhods-dashboard', code='5xx'})
142
+ ${response_2xx } = Prometheus.Run Query
143
+ ... pm_url=${RHODS_PROMETHEUS_URL }
144
+ ... pm_token=${RHODS_PROMETHEUS_TOKEN }
145
+ ... pm_query=sum(haproxy_backend_http_responses_total{route='rhods-dashboard', code='2xx'})
146
+ ${response_total } = Prometheus.Run Query
147
+ ... pm_url=${RHODS_PROMETHEUS_URL }
148
+ ... pm_token=${RHODS_PROMETHEUS_TOKEN }
149
+ ... pm_query=sum(haproxy_backend_http_responses_total{route='rhods-dashboard'}
150
+
151
+ @{metrics_by_code } = Set Variable ${response_by_code.json()["data"]["result"] }
152
+ ${metrics_by_code_5xx } = Set Variable ${metrics_by_code[4]["value"][-1] }
153
+ ${metrics_by_code_5xx } = Convert To Number ${metrics_by_code_5xx } 2
154
+ ${metrics_by_code_2xx } = Set Variable ${metrics_by_code[1]["value"][-1] }
155
+ ${metrics_by_code_2xx } = Convert To Number ${metrics_by_code_2xx } 2
156
+ ${metrics_5xx } = Set Variable ${response_5xx.json()["data"]["result"][0]["value"][-1] }
157
+ ${metrics_5xx } = Convert To Number ${metrics_5xx } 2
158
+ ${metrics_2xx } = Set Variable ${response_2xx.json()["data"]["result"][0]["value"][-1] }
159
+ ${metrics_2xx } = Convert To Number ${metrics_2xx } 2
160
+ ${metrics_total } = Set Variable ${response_total.json()["data"]["result"][0]["value"][-1] }
161
+ ${metrics_total } = Convert To Number ${metrics_total } 2
162
+
163
+ Should Match ${metrics_by_code_5xx } ${metrics_5xx }
164
+ Should Match ${metrics_by_code_2xx } ${metrics_2xx }
165
+ Should Match ${metrics_total } ${metrics_by_code_5xx } +${metrics_by_code_2xx }
166
+
126
167
127
168
*** Keywords ***
128
169
Begin Metrics Web Test
0 commit comments