From 99e23046947462a3173c589910f985b622bdc671 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Wed, 14 May 2025 08:05:47 -0700 Subject: [PATCH] CU-868d85dv8 Minor change to worker sentry startup location --- Workers/Resgrid.Workers.Console/Program.cs | 37 +++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Workers/Resgrid.Workers.Console/Program.cs b/Workers/Resgrid.Workers.Console/Program.cs index fe60285b..c1d69d86 100644 --- a/Workers/Resgrid.Workers.Console/Program.cs +++ b/Workers/Resgrid.Workers.Console/Program.cs @@ -53,24 +53,6 @@ static async Task Main(string[] args) LoadConfiguration(args); - Resgrid.Framework.Logging.Initialize(ExternalErrorConfig.ExternalErrorServiceUrlForWebjobs); - - if (!String.IsNullOrWhiteSpace(ExternalErrorConfig.ExternalErrorServiceUrlForWebjobs)) - { - SentrySdk.Init(options => - { - options.Dsn = Config.ExternalErrorConfig.ExternalErrorServiceUrlForWebjobs; - options.AttachStacktrace = true; - options.SendDefaultPii = true; - options.AutoSessionTracking = true; - options.TracesSampleRate = ExternalErrorConfig.SentryPerfSampleRate; - options.ProfilesSampleRate = ExternalErrorConfig.SentryProfilingSampleRate; - options.IsGlobalModeEnabled = true; - options.Environment = ExternalErrorConfig.Environment; - options.Release = Assembly.GetEntryAssembly().GetName().Version.ToString(); - }); - } - Prime(); var builder = new HostBuilder() @@ -104,6 +86,25 @@ static async Task Main(string[] args) logging.AddConsole(); }); + Resgrid.Framework.Logging.Initialize(ExternalErrorConfig.ExternalErrorServiceUrlForWebjobs); + + if (!String.IsNullOrWhiteSpace(ExternalErrorConfig.ExternalErrorServiceUrlForWebjobs)) + { + SentrySdk.Init(options => + { + options.Dsn = Config.ExternalErrorConfig.ExternalErrorServiceUrlForWebjobs; + options.AttachStacktrace = true; + options.SendDefaultPii = true; + options.AutoSessionTracking = true; + options.TracesSampleRate = ExternalErrorConfig.SentryPerfSampleRate; + options.ProfilesSampleRate = ExternalErrorConfig.SentryProfilingSampleRate; + options.IsGlobalModeEnabled = true; + options.Environment = ExternalErrorConfig.Environment; + options.Release = Assembly.GetEntryAssembly().GetName().Version.ToString(); + }); + } + + await builder.RunConsoleAsync(); }