From 1e428fcc0147a571f46fa03453667adf3dc3c782 Mon Sep 17 00:00:00 2001 From: George Drak Date: Thu, 27 Apr 2023 16:43:02 +0500 Subject: [PATCH 1/2] feat(sentry): set default tags with app info --- src/Sitko.Core.Sentry/SentryModule.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Sitko.Core.Sentry/SentryModule.cs b/src/Sitko.Core.Sentry/SentryModule.cs index 07301b387..e2626e95a 100644 --- a/src/Sitko.Core.Sentry/SentryModule.cs +++ b/src/Sitko.Core.Sentry/SentryModule.cs @@ -21,6 +21,10 @@ public void PostConfigureHostBuilder(IApplicationContext context, IHostBuilder h o.Dsn = startupOptions.Dsn; o.Debug = startupOptions.EnableDebug; o.TracesSampleRate = startupOptions.TracesSampleRate; + o.DefaultTags.Add("ServiceId", context.Id.ToString()); + o.DefaultTags.Add("Service", context.Name); + o.DefaultTags.Add("Environment", context.Environment); + o.DefaultTags.Add("Version", context.Version); startupOptions.ConfigureSentryOptions?.Invoke(context, o, startupOptions); }); }); From 9e50df679c1e80a957ad249c37388f30fbcff0a4 Mon Sep 17 00:00:00 2001 From: George Drak Date: Thu, 27 Apr 2023 16:54:30 +0500 Subject: [PATCH 2/2] fix(app): incorrect default env name setup --- src/Sitko.Core.App/IApplicationContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sitko.Core.App/IApplicationContext.cs b/src/Sitko.Core.App/IApplicationContext.cs index 2a18c5853..337e18908 100644 --- a/src/Sitko.Core.App/IApplicationContext.cs +++ b/src/Sitko.Core.App/IApplicationContext.cs @@ -74,7 +74,7 @@ private ApplicationOptions GetApplicationOptions() if (string.IsNullOrEmpty(applicationOptions.Environment)) { - applicationOptions.Version = AspNetEnvironmentName; + applicationOptions.Environment = AspNetEnvironmentName; } ConfigureApplicationOptions(applicationOptions);