Skip to content

Commit

Permalink
test-monitoring - fetching metrics - wait for not null value
Browse files Browse the repository at this point in the history
This change prevents the CI suite to fail due to an unexpected "null" value
when fetching data from prometheus.

This change now waits ~60s until we get a proper value.

Change-Id: I6cc2429842fab79e7bfc3ed8bbf848ca9accb020
  • Loading branch information
morucci committed Nov 22, 2023
1 parent 083f2b5 commit 156e656
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/health-check/test-monitoring/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@
- name: Fetch a basic Zuul metric exporter by statsd
ansible.builtin.shell: curl -k https://{{ prometheus_host }}/api/v1/query?query=zuul_executors_online | jq '.data.result[0].value[1]'
register: zeo
until: zeo.stdout != "" and "null" not in zeo.stdout
retries: 60
delay: 1

# config-update-nodepool-builder should at least trigger one tick for readiness.
- name: Fetch a basic Nodepool metric exported by statsd
ansible.builtin.shell: curl -k https://{{ prometheus_host }}/api/v1/query?query=nodepool_launch_ready | jq '.data.result[0].value[1]'
register: nlr
until: nlr.stdout != "" and "null" not in nlr.stdout
retries: 60
delay: 1

# Use a dictionary to trick Ansible into casting metrics to int/float
- set_fact:
Expand Down

0 comments on commit 156e656

Please sign in to comment.