From 2487e8ed49f566c0539122e288994c8d3f13e9f6 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Thu, 5 Jan 2017 10:25:50 -0800 Subject: [PATCH] Don't report errors that don't have exceptions --- .../Instrumentation/Sentry/SentryTarget.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs index 2dceead2b..4be22f0a9 100644 --- a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs @@ -59,7 +59,7 @@ namespace NzbDrone.Common.Instrumentation.Sentry try { // don't report non-critical events without exceptions - if (logEvent.Exception == null && logEvent.Level < LogLevel.Warn) + if (logEvent.Exception == null) { return; } @@ -78,10 +78,15 @@ namespace NzbDrone.Common.Instrumentation.Sentry { logEvent.Level.ToString(), logEvent.LoggerName, - logEvent.Exception?.GetType().ToString() + logEvent.Message } }; + if (logEvent.Exception != null) + { + sentryEvent.Fingerprint.Add(logEvent.Exception.GetType().FullName); + } + sentryEvent.Tags.Add("os_name", Environment.GetEnvironmentVariable("OS_NAME")); sentryEvent.Tags.Add("os_version", Environment.GetEnvironmentVariable("OS_VERSION")); sentryEvent.Tags.Add("runtime_version", Environment.GetEnvironmentVariable("RUNTIME_VERSION"));