qontract-reconcile 0.10.1rc1132__py3-none-any.whl → 0.10.1rc1133__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc1132
3
+ Version: 0.10.1rc1133
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -17,7 +17,7 @@ reconcile/dashdotdb_base.py,sha256=l34QDu1G96_Ctnh7ZXdxXgSeCE93GQMdLAkWxmN6vDA,4
17
17
  reconcile/dashdotdb_cso.py,sha256=IkI_KSZuH_kPn0cIQKXitJXiPPFSyHykrOuFy9h9ZpU,3643
18
18
  reconcile/dashdotdb_dora.py,sha256=YmfxD02tKUAQQzku2aj2DXv1oKkAr4V_2lrPVtTFGyI,17674
19
19
  reconcile/dashdotdb_dvo.py,sha256=lCkZ0iby6HrNQb-3kYb6xrt8wCjVUZYxKzz9SiStfHU,8946
20
- reconcile/dashdotdb_slo.py,sha256=S7j7xFeGaJkE82biWEdPu6ORCJEsJYNTDqcTzSl8AQY,6679
20
+ reconcile/dashdotdb_slo.py,sha256=s-AMW927seimHou19h4fHnvjUJwkXcJRBEHi6HjOMI8,7106
21
21
  reconcile/database_access_manager.py,sha256=FfyXnYcUdX54BYR_6B9PWFmhT8xdNrPCfoz3Q7q39tg,25646
22
22
  reconcile/deadmanssnitch.py,sha256=n-5W-djUgwzpmdDM4eQIZpkkDmHY0vndt-42LJXI4Y8,7491
23
23
  reconcile/email_sender.py,sha256=-5L-Ag_jaEYSzYRoMr52KQBRXz1E8yx9GqLbg2X4XFU,3533
@@ -871,8 +871,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
871
871
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
872
872
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
873
873
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
874
- qontract_reconcile-0.10.1rc1132.dist-info/METADATA,sha256=lELtTQsA2H3TPWaNDegyi61VlMiwzJkt9pEYK0BdARA,2213
875
- qontract_reconcile-0.10.1rc1132.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
876
- qontract_reconcile-0.10.1rc1132.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
877
- qontract_reconcile-0.10.1rc1132.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
878
- qontract_reconcile-0.10.1rc1132.dist-info/RECORD,,
874
+ qontract_reconcile-0.10.1rc1133.dist-info/METADATA,sha256=-7WqkBwuhgv_OY_C53SD1T0bN9WAMFeIQEZrqGYCUYU,2213
875
+ qontract_reconcile-0.10.1rc1133.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
876
+ qontract_reconcile-0.10.1rc1133.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
877
+ qontract_reconcile-0.10.1rc1133.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
878
+ qontract_reconcile-0.10.1rc1133.dist-info/RECORD,,
@@ -1,5 +1,6 @@
1
1
  from collections.abc import Iterable
2
2
  from dataclasses import dataclass
3
+ from math import isnan
3
4
  from typing import Any
4
5
 
5
6
  import jinja2
@@ -83,10 +84,13 @@ class DashdotdbSLO(DashdotdbBase):
83
84
  continue
84
85
 
85
86
  LOG.info("%s syncing slo %s", self.logmarker, slo_name)
86
- response = self._do_post(endpoint, payload)
87
87
  try:
88
+ response = self._do_post(endpoint, payload)
88
89
  response.raise_for_status()
89
- except requests.exceptions.HTTPError as details:
90
+ except (
91
+ requests.exceptions.HTTPError,
92
+ requests.exceptions.InvalidJSONError,
93
+ ) as details:
90
94
  LOG.error("%s error posting %s - %s", self.logmarker, slo_name, details)
91
95
 
92
96
  LOG.info("%s slo %s synced", self.logmarker, slo_name)
@@ -144,6 +148,12 @@ class DashdotdbSLO(DashdotdbBase):
144
148
  continue
145
149
 
146
150
  slo_value = float(slo_value[1])
151
+ if isnan(slo_value):
152
+ LOG.warning(
153
+ f"{self.logmarker} Skipping SLO '{slo.name}' in SLO doc '{slo_document.name}'"
154
+ "as the obtained value is not a number (maybe a division by 0?)"
155
+ )
156
+ continue
147
157
  slo_target = float(slo.slo_target)
148
158
 
149
159
  # In Dash.DB we want to always store SLOs in percentages