From c65c8a535ca76338198000d86e30e36a0574a3fd Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 17 Jan 2025 02:39:51 -0500 Subject: [PATCH 1/6] no duplicate --- system/sentry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/sentry.py b/system/sentry.py index 02a02c7e0e..00a85fadc5 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -19,10 +19,11 @@ CRASHES_DIR = Paths.crash_log_root() class SentryProject(Enum): + project = "https://7e3be9bfcfe04c9abe58bd25fe290d1a@o1138119.ingest.sentry.io/6191481" # python project - SELFDRIVE = "https://7e3be9bfcfe04c9abe58bd25fe290d1a@o1138119.ingest.sentry.io/6191481" + SELFDRIVE = project # native project - SELFDRIVE_NATIVE = "https://7e3be9bfcfe04c9abe58bd25fe290d1a@o1138119.ingest.sentry.io/6191481" + SELFDRIVE_NATIVE = project def report_tombstone(fn: str, message: str, contents: str) -> None: From 976c9ac9bf6c8d950cdb213df9ac90abab15dfd9 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 17 Jan 2025 02:40:27 -0500 Subject: [PATCH 2/6] typo --- system/sentry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/sentry.py b/system/sentry.py index 00a85fadc5..bb7743fcfe 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -70,7 +70,7 @@ def save_exception(content: str) -> None: cloudlog.error(f"logged crash to {files}") except Exception: - cloudlog.exception("error when attemping to save exception") + cloudlog.exception("error when attempting to save exception") def capture_fingerprint_mock() -> None: From 59b68e42f6305fa3b1d40cc2f544c651c8d0eb7e Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 17 Jan 2025 10:29:17 -0500 Subject: [PATCH 3/6] don't use deprecated method --- system/sentry.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/sentry.py b/system/sentry.py index bb7743fcfe..c5f8ba000c 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -81,13 +81,13 @@ def capture_fingerprint_mock() -> None: def capture_fingerprint(candidate: str, car_name: str) -> None: - with sentry_sdk.configure_scope() as scope: - set_user() - scope.set_extra("carFingerprint", candidate) - scope.set_extra("carName", car_name) - message = f"Fingerprinted {candidate}" - sentry_sdk.capture_message(message=message, level="info") - sentry_sdk.flush() + set_user() + sentry_sdk.set_tag("carFingerprint", candidate) + sentry_sdk.set_tag("carName", car_name) + + message = f"Fingerprinted {candidate}" + sentry_sdk.capture_message(message=message, level="info") + sentry_sdk.flush() def set_tag(key: str, value: str) -> None: From 66eb3a253261f2439757b084d4990b21bfd05f62 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 17 Jan 2025 10:47:25 -0500 Subject: [PATCH 4/6] wrap them around --- system/sentry.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/system/sentry.py b/system/sentry.py index c5f8ba000c..2dd003190e 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -74,20 +74,26 @@ def save_exception(content: str) -> None: def capture_fingerprint_mock() -> None: - set_user() - message = "car doesn't match any fingerprints" - sentry_sdk.capture_message(message=message, level="error") - sentry_sdk.flush() + try: + set_user() + message = "car doesn't match any fingerprints" + sentry_sdk.capture_message(message=message, level="error") + sentry_sdk.flush() + except Exception as e: + cloudlog.exception(f"sentry fingerprint MOCK exception: {e}") def capture_fingerprint(candidate: str, car_name: str) -> None: - set_user() - sentry_sdk.set_tag("carFingerprint", candidate) - sentry_sdk.set_tag("carName", car_name) + try: + set_user() + sentry_sdk.set_tag("carFingerprint", candidate) + sentry_sdk.set_tag("carName", car_name) - message = f"Fingerprinted {candidate}" - sentry_sdk.capture_message(message=message, level="info") - sentry_sdk.flush() + message = f"Fingerprinted {candidate}" + sentry_sdk.capture_message(message=message, level="info") + sentry_sdk.flush() + except Exception as e: + cloudlog.exception(f"sentry fingerprint exception: {e}") def set_tag(key: str, value: str) -> None: From ab8dd45cdac90ecad49a96cd2de104561033f27d Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 17 Jan 2025 10:57:06 -0500 Subject: [PATCH 5/6] do this instead --- system/sentry.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/sentry.py b/system/sentry.py index 2dd003190e..976feef801 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -19,11 +19,10 @@ CRASHES_DIR = Paths.crash_log_root() class SentryProject(Enum): - project = "https://7e3be9bfcfe04c9abe58bd25fe290d1a@o1138119.ingest.sentry.io/6191481" # python project - SELFDRIVE = project + SELFDRIVE = "https://7e3be9bfcfe04c9abe58bd25fe290d1a@o1138119.ingest.sentry.io/6191481" # native project - SELFDRIVE_NATIVE = project + SELFDRIVE_NATIVE = SELFDRIVE def report_tombstone(fn: str, message: str, contents: str) -> None: From 45c47d0c48a4e5f60b3e91b09dbc2e82d044b5a7 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 17 Jan 2025 12:01:11 -0500 Subject: [PATCH 6/6] new endpoint --- system/sentry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/sentry.py b/system/sentry.py index 976feef801..9978d174a4 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -20,7 +20,7 @@ CRASHES_DIR = Paths.crash_log_root() class SentryProject(Enum): # python project - SELFDRIVE = "https://7e3be9bfcfe04c9abe58bd25fe290d1a@o1138119.ingest.sentry.io/6191481" + SELFDRIVE = "https://186a6736b7927e5ae9b92c869ba81b6b@o1138119.ingest.us.sentry.io/4508660076052480" # native project SELFDRIVE_NATIVE = SELFDRIVE