Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sentry error reporting for all fatal errors #815

Merged

Conversation

flyingsilverfin
Copy link
Member

@flyingsilverfin flyingsilverfin commented Feb 14, 2024

Usage and product changes

We add anonymous Sentry error reporting for all fatal errors in TypeDB Studio. The Studio version and a hash of the mac address (if available) are reported along with the error.

Users can opt-out of the diagnostics reporting with a new checkbox in the Preferences -> System checkbox. Note that a Studio restart is required for the toggle to take effect.

Implementation

  1. We depend on Sentry via maven
  2. Configure Diagnostics reporting to Sentry's TypeDB Studio endpoint
  3. Generate and inject the version number into a source file, which is read and included into TypeDB studio

@vaticle-bot
Copy link
Member

vaticle-bot commented Feb 14, 2024

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

  • This change is trivial and does not require a code or architecture review.

Code

  • Packages, classes, and methods have a single domain of responsibility.
  • Packages, classes, and methods are grouped into cohesive and consistent domain model.
  • The code is canonical and the minimum required to achieve the goal.
  • Modules, libraries, and APIs are easy to use, robust (foolproof and not errorprone), and tested.
  • Logic and naming has clear narrative that communicates the accurate intent and responsibility of each module (e.g. method, class, etc.).
  • The code is algorithmically efficient and scalable for the whole application.

Architecture

  • Any required refactoring is completed, and the architecture does not introduce technical debt incidentally.
  • Any required build and release automations are updated and/or implemented.
  • Any new components follows a consistent style with respect to the pre-existing codebase.
  • The architecture intuitively reflects the application domain, and is easy to understand.
  • The architecture has a well-defined hierarchy of encapsulated components.
  • The architecture is extensible and scalable.

Studio.kt Outdated
@@ -305,6 +315,31 @@ object Studio {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()) // Set UI style for Windows
}

private fun configureDiagnostics() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a very rudimentary hard coding

package(default_visibility = ["//visibility:public"])

genrule(
name = "version-src",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Templated version file, just like in Core

@alexjpwalker alexjpwalker mentioned this pull request Feb 14, 2024
3 tasks
Copy link
Member

@alexjpwalker alexjpwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@flyingsilverfin flyingsilverfin merged commit 15e5084 into vaticle:development Jun 21, 2024
5 checks passed
@flyingsilverfin flyingsilverfin deleted the sentry-diagnostics branch June 21, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants