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

Revert "Soufiane correction" #19

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
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
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
Loading