From aa9508f1be1791c234f10c446efd4e5a6528da83 Mon Sep 17 00:00:00 2001 From: Ram Senthamarai Date: Tue, 17 Sep 2024 20:49:12 -0700 Subject: [PATCH] =?UTF-8?q?chore(dynamic=20alert=20thresholds)=20Make=20pr?= =?UTF-8?q?oject=20id=20optional=20for=20delete=20e=E2=80=A6=20(#1174)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …nd point --- src/seer/anomaly_detection/models/external.py | 2 +- src/seer/app.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/seer/anomaly_detection/models/external.py b/src/seer/anomaly_detection/models/external.py index 43d2f910..3183c651 100644 --- a/src/seer/anomaly_detection/models/external.py +++ b/src/seer/anomaly_detection/models/external.py @@ -92,7 +92,7 @@ class StoreDataResponse(BaseModel): class DeleteAlertDataRequest(BaseModel): organization_id: int - project_id: int + project_id: Optional[int] = Field(None) alert: AlertInSeer diff --git a/src/seer/app.py b/src/seer/app.py index 62fdc5d6..6cdf8f1a 100644 --- a/src/seer/app.py +++ b/src/seer/app.py @@ -281,7 +281,8 @@ def delete_alert__data_endpoint( data: DeleteAlertDataRequest, ) -> DeleteAlertDataResponse: sentry_sdk.set_tag("organization_id", data.organization_id) - sentry_sdk.set_tag("project_id", data.project_id) + if data.project_id is not None: + sentry_sdk.set_tag("project_id", data.project_id) sentry_sdk.set_tag("alert_id", data.alert.id) try: response = anomaly_detection().delete_alert_data(data)