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