Skip to content

Commit

Permalink
Revert "Revert "Revert "Soufiane correction"""
Browse files Browse the repository at this point in the history
  • Loading branch information
soufiane5902 authored Sep 9, 2024
1 parent 7c9b6c0 commit 43da55f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion slo_generator/backends/datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def query_slo(self, timestamp, window, slo_config):
slo_data = data["data"]["series"]

# check if a correction is set
if "corrections" in data["data"]["overall"] and len(data["data"]["overall"]["corrections"]) != 0:
if len(data["data"]["overall"]["corrections"]) != 0:
try:
# query slo without correction
data_without_correction = self.client.ServiceLevelObjective.history(
Expand Down
2 changes: 1 addition & 1 deletion slo_generator/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def export(data: dict, exporters: list, raise_on_error: bool = False) -> list:
if cls not in constants.V2_EXPORTERS:
LOGGER.debug(f"{info} | Converting SLO report to v1.")
json_data = report_v2tov1(data)
if json_data['metadata']['source'] == 'datadog' and slo_generator.backends.datadog.slo_data != {} and "correction" in json_data:
if json_data['metadata']['source'] == 'datadog' and slo_generator.backends.datadog.slo_data != {}:
json_data["correction"] = slo_generator.backends.datadog.slo_data.get("groups", {})
LOGGER.debug(f"{info} | SLO report: {json_data}")
response = instance().export(json_data, **exporter)
Expand Down

0 comments on commit 43da55f

Please sign in to comment.