Skip to content

Commit 543e08f

Browse files
committed
Fix to getting loki data downloaded
1 parent 2ea2e7a commit 543e08f

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

roles/telemetry_chargeback/tasks/gen_synth_loki_data.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@
3535
when: not file_preexists.stat.exists | bool
3636
changed_when: cloudkitty_synth_totals_file_output.rc == 0
3737
any_errors_fatal: true
38+
39+
## validating changes
40+
- name: "Load synthetic metrics summary for {{ scenario_name }}"
41+
ansible.builtin.include_vars:
42+
file: "{{ cloudkitty_synth_totals_file }}"
43+
name: synth_data_rates

roles/telemetry_chargeback/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
rescue:
2828
- name: "Log failure"
29-
ansible.builtin.debug:
30-
msg: "Running test scenarios loop failed."
29+
ansible.builtin.fail:
30+
msg: "Running test scenarios loop failed. Please check logs"
3131

3232
always:
3333
- name: "Cleanup after job run"

roles/telemetry_chargeback/tasks/retrieve_loki_data.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: "Expected Count {{ scenario_name }}"
33
ansible.builtin.debug:
4-
msg: "Input file has {{ synth_data_rates.data_log.log_count }} data entries that Loki has to return"
4+
msg: "Input file has {{ synth_data_rates.data_summary.log_count }} data entries that Loki has to return"
55

66
# Query Loki
77
- name: "Retrieve Logs from Loki via API {{ scenario_name }}"
@@ -22,7 +22,7 @@
2222
- loki_response.status == 200
2323
- loki_response.json.status == 'success'
2424
- loki_response.json.data.result | length > 0
25-
- (loki_response.json.data.result | map(attribute='values') | map('length') | sum) >= (synth_data_rates.data_log.log_count | int)
25+
- (loki_response.json.data.result | map(attribute='values') | map('length') | sum) >= (synth_data_rates.data_summary.log_count | int)
2626
retries: 25
2727
delay: 60
2828

@@ -40,12 +40,12 @@
4040
that:
4141
- loki_response.json.status == 'success'
4242
- loki_response.json.data.result | length > 0
43-
- actual_count | int == (synth_data_rates.data_log.log_count | int)
43+
- actual_count | int == (synth_data_rates.data_summary.log_count | int)
4444
fail_msg: >-
4545
Query did not return all data entries. Expected
46-
{{ synth_data_rates.data_log.log_count }} log entries, but Loki
46+
{{ synth_data_rates.data_summary.log_count }} log entries, but Loki
4747
only returned {{ actual_count }}
48-
success_msg: "Query returned all data entries. Input file had {{ synth_data_rates.data_log.log_count }} entries and Loki returned {{ actual_count }}"
48+
success_msg: "Query returned all data entries. Input file had {{ synth_data_rates.data_summary.log_count }} entries and Loki returned {{ actual_count }}"
4949

5050
rescue:
5151
- name: "Debug failure"

0 commit comments

Comments
 (0)