Skip to content

Commit 7905237

Browse files
committed
sentry capture for tracking
1 parent 5fa465f commit 7905237

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

codeflash/api/cfapi.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import TYPE_CHECKING, Any, Optional
99

1010
import requests
11+
import sentry_sdk
1112
from pydantic.json import pydantic_encoder
1213

1314
from codeflash.cli_cmds.console import console, logger
@@ -182,9 +183,13 @@ def get_blocklisted_functions() -> dict[str, set[str]] | dict[str, Any]:
182183
internal_server_error = 500
183184

184185
owner, repo = get_repo_owner_and_name()
185-
information = {"pr_number": pr_number, "repo_owner": owner, "repo_name": repo}
186+
information = {"pr_number": pr_number, "repo_owner": owner, "repo_name": repo, "userId": get_user_id()}
186187
try:
187-
req = make_cfapi_request(endpoint="/verify-existing-optimizations", method="POST", payload=information)
188+
req = make_cfapi_request(
189+
endpoint="/verify-existing-optimizations",
190+
method="POST",
191+
payload=information,
192+
)
188193
if req.status_code == not_found:
189194
logger.debug(req.json()["message"])
190195
return {}
@@ -194,7 +199,11 @@ def get_blocklisted_functions() -> dict[str, set[str]] | dict[str, Any]:
194199
req.raise_for_status()
195200
content: dict[str, list[str]] = req.json()
196201
except Exception as e:
197-
logger.error(f"Error getting blocklisted functions: {e}", exc_info=True)
202+
logger.error(f"Error getting blocklisted functions: {e}")
203+
sentry_sdk.capture_exception(e)
198204
return {}
199205

200-
return {Path(k).name: {v.replace("()", "") for v in values} for k, values in content.items()}
206+
return {
207+
Path(k).name: {v.replace("()", "") for v in values}
208+
for k, values in content.items()
209+
}

0 commit comments

Comments
 (0)