Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: add monitoring test to check rhoai dashboard metrics by code #2175

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
@{list_values} = Create List 1 0
Should Contain ${list_values} ${resp.json()["data"]["result"][0]["value"][-1]}


Test Targets Are Available And Up In RHOAI Prometheus
[Documentation] Verifies the expected targets in Prometheus are available and up running
[Tags] Sanity
Expand Down Expand Up @@ -123,6 +122,48 @@
List Should Contain Value ${targets} user_facing_endpoints_status_rhods_dashboard
List Should Contain Value ${targets} user_facing_endpoints_status_workbenches

Test RHOAI Dashboard Metrics By Code Are Defined

Check warning

Code scanning / Robocop

Test case '{{ test_name }}' is too long ({{ test_length }}/{{ allowed_length }}) Warning test

Test case 'Test RHOAI Dashboard Metrics By Code Are Defined' is too long (40/20)

Check warning

Code scanning / Robocop

Test case '{{ test_name }}' has too many keywords inside ({{ keyword_count }}/{{ max_allowed_count }}) Warning test

Test case 'Test RHOAI Dashboard Metrics By Code Are Defined' has too many keywords inside (19/10)
[Documentation] Verifies the RHOAI Dashboard Metrics By Code Are Defined and show accurate values
... (2xx and 5xx codes)
[Tags] Sanity
... Tier1
... ODS-195
... RHOAIENG-13261
... Monitoring
Skip If RHODS Is Self-Managed
${response_by_code} = Prometheus.Run Query
... pm_url=${RHODS_PROMETHEUS_URL}
... pm_token=${RHODS_PROMETHEUS_TOKEN}
... pm_query=sum(haproxy_backend_http_responses_total {route='rhods-dashboard'}) by(code)
${response_5xx} = Prometheus.Run Query
... pm_url=${RHODS_PROMETHEUS_URL}
... pm_token=${RHODS_PROMETHEUS_TOKEN}
... pm_query=sum(haproxy_backend_http_responses_total{route='rhods-dashboard', code='5xx'})
${response_2xx} = Prometheus.Run Query
... pm_url=${RHODS_PROMETHEUS_URL}
... pm_token=${RHODS_PROMETHEUS_TOKEN}
... pm_query=sum(haproxy_backend_http_responses_total{route='rhods-dashboard', code='2xx'})
${response_total} = Prometheus.Run Query
... pm_url=${RHODS_PROMETHEUS_URL}
... pm_token=${RHODS_PROMETHEUS_TOKEN}
... pm_query=sum(haproxy_backend_http_responses_total{route='rhods-dashboard'})

@{metrics_by_code} = Set Variable ${response_by_code.json()["data"]["result"]}
${metrics_by_code_5xx} = Set Variable ${metrics_by_code[4]["value"][-1]}
${metrics_by_code_5xx} = Convert To Number ${metrics_by_code_5xx} 2
${metrics_by_code_2xx} = Set Variable ${metrics_by_code[1]["value"][-1]}
${metrics_by_code_2xx} = Convert To Number ${metrics_by_code_2xx} 2
${metrics_5xx} = Set Variable ${response_5xx.json()["data"]["result"][0]["value"][-1]}
${metrics_5xx} = Convert To Number ${metrics_5xx} 2
${metrics_2xx} = Set Variable ${response_2xx.json()["data"]["result"][0]["value"][-1]}
${metrics_2xx} = Convert To Number ${metrics_2xx} 2
${metrics_total} = Set Variable ${response_total.json()["data"]["result"][0]["value"][-1]}
${metrics_total} = Convert To Number ${metrics_total} 2

Should Be True ${metrics_by_code_5xx} == ${metrics_5xx}
Should Be True ${metrics_by_code_2xx} == ${metrics_2xx}
Comment on lines +163 to +164
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more testing Prometheus aggregation than the actual metrics as this is the same metric just queried multiple times with different filters but I guess that is the only meaningful check we can do that there is any data. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, know its a bit redundant, but is the only check that we can do using these data

Should Be True ${metrics_total} == ${metrics_by_code_5xx}+${metrics_by_code_2xx}


*** Keywords ***
Begin Metrics Web Test
Expand Down
Loading