diff --git a/CommonHelpers/Instance.cs b/CommonHelpers/Instance.cs index 0fe33c5..9267333 100644 --- a/CommonHelpers/Instance.cs +++ b/CommonHelpers/Instance.cs @@ -2,6 +2,7 @@ using System.Security.Principal; using System.Security.AccessControl; using Microsoft.Win32; using System.Diagnostics; +using System.Reflection; namespace CommonHelpers { @@ -171,13 +172,18 @@ namespace CommonHelpers } } + public static String ApplicationName + { + get { return Assembly.GetEntryAssembly()?.GetName().Name ?? "unknown"; } + } + public static String MachineID { get { try { - using (var registryKey = Registry.CurrentUser.OpenSubKey(@"Software\SteamDeckTools", true)) + using (var registryKey = Registry.CurrentUser.CreateSubKey(@"Software\SteamDeckTools", true)) { var machineID = registryKey?.GetValue("MachineID") as string; if (machineID is null) @@ -221,6 +227,11 @@ namespace CommonHelpers updateTimer.Start(); } + Sentry.SentrySdk.CaptureMessage("Updater: " + ApplicationName, scope => + { + scope.SetTag("type", user ? "user" : "background"); + }); + try { Process.Start(new ProcessStartInfo() diff --git a/CommonHelpers/Log.cs b/CommonHelpers/Log.cs index ce2b4be..29b881f 100644 --- a/CommonHelpers/Log.cs +++ b/CommonHelpers/Log.cs @@ -16,12 +16,17 @@ namespace CommonHelpers internal static void SentryOptions(Sentry.SentryOptions o) { + var build = Instance.IsDEBUG ? "debug" : "release"; + var type = File.Exists("Uninstaller.exe") ? "setup" : "zip"; + o.Dsn = Log.SENTRY_DSN; - o.Environment = File.Exists("Uninstaller.exe") ? "setup_" : "zip_"; - o.Environment += Instance.IsDEBUG ? "debug" : "release"; o.TracesSampleRate = 1.0; o.IsGlobalModeEnabled = true; + o.Environment = String.Format("{0}:{1}_{2}", Instance.ApplicationName, build, type); + o.DefaultTags.Add("App", Instance.ApplicationName); o.DefaultTags.Add("MachineID", Instance.MachineID); + o.DefaultTags.Add("Build", type); + o.DefaultTags.Add("Configuration", build); var releaseVersion = typeof(Log).Assembly.GetCustomAttributes().FirstOrDefault(); if (releaseVersion is not null) diff --git a/RELEASE.md b/RELEASE.md index 7b179a3..c01a587 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -27,5 +27,5 @@ - Add `Updater.exe` that can update to latest release and debug - Add `Setup.exe` installer to install all except RTSS - Fix `Use X360 with Steam` that was broken with `0.5.33` -- Add `Sentry` error tracking -- Tune `PowerControl` key repeats \ No newline at end of file +- Add `Sentry` error tracking (updated) +- Tune `PowerControl` key repeats