From 9fd446fe04018349dde660b0922ad2b79780c510 Mon Sep 17 00:00:00 2001 From: Sergey Karmanov Date: Sun, 8 Mar 2026 03:34:21 +0300 Subject: [PATCH] =?UTF-8?q?feat(sentry):=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B8=D0=BD=D1=82=D0=B5=D0=B3=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8E=20Sentry=20=D0=B4=D0=BB=D1=8F=20=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SfeduSchedule/Program.cs | 10 ++++++++++ SfeduSchedule/SfeduSchedule.csproj | 4 +++- docker-compose-prod.yml | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/SfeduSchedule/Program.cs b/SfeduSchedule/Program.cs index 8b63336..cf90d6e 100644 --- a/SfeduSchedule/Program.cs +++ b/SfeduSchedule/Program.cs @@ -82,6 +82,15 @@ if (!string.IsNullOrEmpty(configuration[AppConsts.TgChatIdEnv]) && !string.IsNul }); #endregion +builder.WebHost.UseSentry(options => +{ + options.Dsn = configuration["Sentry:Dsn"] ?? ""; + options.EnableLogs = true; + options.TracesSampleRate = 1.0; + options.ProfilesSampleRate = 1.0; + options.AddProfilingIntegration(); +}); + // Включаем MVC контроллеры var mvcBuilder = builder.Services.AddControllers(); builder.Services.AddHttpClient("modeus", client => @@ -316,6 +325,7 @@ app.UseSwaggerUI(); app.UseStaticFiles(); app.UseRouting(); +app.UseSentryTracing(); app.UseAuthentication(); app.UseAuthorization(); diff --git a/SfeduSchedule/SfeduSchedule.csproj b/SfeduSchedule/SfeduSchedule.csproj index 531b0ed..5f33c6c 100644 --- a/SfeduSchedule/SfeduSchedule.csproj +++ b/SfeduSchedule/SfeduSchedule.csproj @@ -14,7 +14,9 @@ - + + + diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index 741a0bc..1b7e2b6 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -17,6 +17,7 @@ services: # - TOKEN=${TOKEN} - AUTH_URL=${AUTH_URL} - AUTH_API_KEY=${AUTH_API_KEY} + - Sentry:Dsn=${SENTRY_DSN:-} volumes: - data:/app/data restart: always