Skip to content

Commit

Permalink
fix: #OBS-I354 dataset level alert metric caching issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JeraldJF committed Jan 9, 2025
1 parent ad844b9 commit d6937f9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions command-service/src/command/alert_manager_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from model.data_models import Action, ActionResponse, CommandPayload
from service.db_service import DatabaseService
from service.http_service import HttpService

from copy import deepcopy

class AlertManagerService(ICommand):

Expand Down Expand Up @@ -95,17 +95,18 @@ def get_dataset_source_config(self, dataset_id: str) -> str:
def get_modified_metric(
self, service: str, metric: dict, payload: CommandPayload
) -> dict:
metric_data = deepcopy(metric)
if service == "flink":
substring = f"{payload.dataset_id}"
modified_substring = substring.replace("-", "_")
modified_metric = metric["metric"].replace("dataset_id", modified_substring)
metric["metric"] = modified_metric
return metric
modified_metric = metric_data["metric"].replace("dataset_id", modified_substring)
metric_data["metric"] = modified_metric
return metric_data
else:
metric["metric"] = metric["metric"].replace(
metric_data["metric"] = metric_data["metric"].replace(
"dataset_id", payload.dataset_id
)
return metric
return metric_data

def create_alert_metric(
self, payload: CommandPayload, service: str, metric: dict, dataset_name: str
Expand Down

0 comments on commit d6937f9

Please sign in to comment.