Skip to content

Commit

Permalink
chore(linux): Add more details to Sentry events
Browse files Browse the repository at this point in the history
This change adds additional details to Sentry events so that the "All
Events" tab on keyman.sentry.io will show helpful values in the
"device" and "os" columns instead of emptry strings.
  • Loading branch information
ermshiperete committed Oct 9, 2023
1 parent 9650b3f commit 1dd3eae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions linux/keyman-config/keyman_config/sentry_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ def _sentry_sdk_initialize(self):
scope.set_tag("platform", platform.platform())
scope.set_tag("system", platform.system())
scope.set_tag("tier", __tier__)
scope.set_tag("device", platform.node())
try:
os_release = platform.freedesktop_os_release()
scope.set_tag('os', os_release['PRETTY_NAME'])
scope.set_tag('os.name', os_release['NAME'])
if 'VERSION' in os_release:
scope.set_tag('os.version', os_release['VERSION'])
except OSError as e:
logging.debug(f'System does not have os_release file: {e.strerror}')
logging.info("Initialized Sentry error reporting")

def _raven_initialize(self):
Expand Down

0 comments on commit 1dd3eae

Please sign in to comment.