From dfbd658a2f73996b409aacb520ccd96678ac8dbd Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 14 Dec 2020 07:11:54 -0800 Subject: [PATCH] log remote and branch in sentry (#16766) * log remote and branch in sentry * also add to crash.py Co-authored-by: Willem Melching --- selfdrive/crash.py | 10 ++++++++-- selfdrive/tombstoned.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/selfdrive/crash.py b/selfdrive/crash.py index 22d6aa0680..1bf57d199c 100644 --- a/selfdrive/crash.py +++ b/selfdrive/crash.py @@ -3,7 +3,7 @@ import os import sys import threading import capnp -from selfdrive.version import version, dirty +from selfdrive.version import version, dirty, origin, branch from selfdrive.swaglog import cloudlog from common.hardware import PC @@ -23,8 +23,14 @@ if os.getenv("NOLOG") or os.getenv("NOCRASH") or PC: else: from raven import Client from raven.transport.http import HTTPTransport + + tags = { + 'dirty': dirty, + 'origin': origin, + 'branch': branch + } client = Client('https://1994756b5e6f41cf939a4c65de45f4f2:cefebaf3a8aa40d182609785f7189bd7@app.getsentry.com/77924', - install_sys_hook=False, transport=HTTPTransport, release=version, tags={'dirty': dirty}) + install_sys_hook=False, transport=HTTPTransport, release=version, tags=tags) def capture_exception(*args, **kwargs): exc_info = sys.exc_info() diff --git a/selfdrive/tombstoned.py b/selfdrive/tombstoned.py index 5a208ffc59..8ae0a147b8 100755 --- a/selfdrive/tombstoned.py +++ b/selfdrive/tombstoned.py @@ -5,7 +5,7 @@ import time from raven import Client from raven.transport.http import HTTPTransport -from selfdrive.version import version, dirty +from selfdrive.version import version, origin, branch, dirty from selfdrive.swaglog import cloudlog MAX_SIZE = 100000 * 10 # Normal size is 40-100k, allow up to 1M @@ -73,8 +73,14 @@ def report_tombstone(fn, client): def main(): initial_tombstones = set(get_tombstones()) + + tags = { + 'dirty': dirty, + 'origin': origin, + 'branch': branch + } client = Client('https://d3b175702f62402c91ade04d1c547e68:b20d68c813c74f63a7cdf9c4039d8f56@sentry.io/157615', - install_sys_hook=False, transport=HTTPTransport, release=version, tags={'dirty': dirty}, string_max_length=10000) + install_sys_hook=False, transport=HTTPTransport, release=version, tags=tags, string_max_length=10000) client.user_context({'id': os.environ.get('DONGLE_ID')}) while True: