feat(sentry): Добавил интеграцию Sentry для логирования и профилирования
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 1m47s
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 1m47s
This commit is contained in:
@@ -82,6 +82,15 @@ if (!string.IsNullOrEmpty(configuration[AppConsts.TgChatIdEnv]) && !string.IsNul
|
|||||||
});
|
});
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
builder.WebHost.UseSentry(options =>
|
||||||
|
{
|
||||||
|
options.Dsn = configuration["Sentry:Dsn"] ?? "";
|
||||||
|
options.EnableLogs = true;
|
||||||
|
options.TracesSampleRate = 1.0;
|
||||||
|
options.ProfilesSampleRate = 1.0;
|
||||||
|
options.AddProfilingIntegration();
|
||||||
|
});
|
||||||
|
|
||||||
// Включаем MVC контроллеры
|
// Включаем MVC контроллеры
|
||||||
var mvcBuilder = builder.Services.AddControllers();
|
var mvcBuilder = builder.Services.AddControllers();
|
||||||
builder.Services.AddHttpClient("modeus", client =>
|
builder.Services.AddHttpClient("modeus", client =>
|
||||||
@@ -316,6 +325,7 @@ app.UseSwaggerUI();
|
|||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
app.UseSentryTracing();
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
<PackageReference Include="Microsoft.Identity.Web" Version="4.3.0" />
|
<PackageReference Include="Microsoft.Identity.Web" Version="4.3.0" />
|
||||||
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1"/>
|
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1"/>
|
||||||
<PackageReference Include="Quartz.AspNetCore" Version="3.15.1"/>
|
<PackageReference Include="Quartz.AspNetCore" Version="3.15.1"/>
|
||||||
|
<PackageReference Include="Sentry.AspNetCore" Version="6.1.0"/>
|
||||||
|
<PackageReference Include="Sentry.Profiling" Version="6.1.0"/>
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6"/>
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6"/>
|
||||||
<PackageReference Include="X.Extensions.Logging.Telegram" Version="2.0.2"/>
|
<PackageReference Include="X.Extensions.Logging.Telegram" Version="2.0.2"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ services:
|
|||||||
# - TOKEN=${TOKEN}
|
# - TOKEN=${TOKEN}
|
||||||
- AUTH_URL=${AUTH_URL}
|
- AUTH_URL=${AUTH_URL}
|
||||||
- AUTH_API_KEY=${AUTH_API_KEY}
|
- AUTH_API_KEY=${AUTH_API_KEY}
|
||||||
|
- Sentry:Dsn=${SENTRY_DSN:-}
|
||||||
volumes:
|
volumes:
|
||||||
- data:/app/data
|
- data:/app/data
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
Reference in New Issue
Block a user