Add support for Sentry.io
This commit is contained in:
parent
48124346c0
commit
9a4aeced64
6 changed files with 28 additions and 4 deletions
|
@ -5,6 +5,7 @@ using Microsoft.Extensions.Hosting;
|
||||||
namespace Retroactiune
|
namespace Retroactiune
|
||||||
{
|
{
|
||||||
[ExcludeFromCodeCoverage]
|
[ExcludeFromCodeCoverage]
|
||||||
|
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")]
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
|
@ -12,8 +13,12 @@ namespace Retroactiune
|
||||||
CreateHostBuilder(args).Build().Run();
|
CreateHostBuilder(args).Build().Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
private static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||||
Host.CreateDefaultBuilder(args)
|
Host.CreateDefaultBuilder(args)
|
||||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
.ConfigureWebHostDefaults(webBuilder =>
|
||||||
|
{
|
||||||
|
webBuilder.UseSentry();
|
||||||
|
webBuilder.UseStartup<Startup>();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,6 +13,7 @@
|
||||||
<PackageReference Include="MongoDB.Driver" Version="2.12.3" />
|
<PackageReference Include="MongoDB.Driver" Version="2.12.3" />
|
||||||
<PackageReference Include="prometheus-net" Version="4.2.0" />
|
<PackageReference Include="prometheus-net" Version="4.2.0" />
|
||||||
<PackageReference Include="prometheus-net.AspNetCore" Version="4.2.0" />
|
<PackageReference Include="prometheus-net.AspNetCore" Version="4.2.0" />
|
||||||
|
<PackageReference Include="Sentry.AspNetCore" Version="3.8.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,13 @@ using Prometheus;
|
||||||
using Retroactiune.Core.Interfaces;
|
using Retroactiune.Core.Interfaces;
|
||||||
using Retroactiune.Core.Services;
|
using Retroactiune.Core.Services;
|
||||||
using Retroactiune.Infrastructure;
|
using Retroactiune.Infrastructure;
|
||||||
|
using Sentry.AspNetCore;
|
||||||
|
|
||||||
namespace Retroactiune
|
namespace Retroactiune
|
||||||
{
|
{
|
||||||
[ExcludeFromCodeCoverage]
|
[ExcludeFromCodeCoverage]
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
// TODO: Support for Sentry.
|
|
||||||
// TODO: External auth provider.
|
// TODO: External auth provider.
|
||||||
// TODO: UI?
|
// TODO: UI?
|
||||||
public Startup(IConfiguration configuration)
|
public Startup(IConfiguration configuration)
|
||||||
|
@ -79,6 +79,7 @@ namespace Retroactiune
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseSentryTracing();
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
{
|
{
|
||||||
|
"Sentry": {
|
||||||
|
"Dsn": "",
|
||||||
|
"Debug": true
|
||||||
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
{
|
{
|
||||||
|
"Sentry": {
|
||||||
|
"Dsn": ""
|
||||||
|
},
|
||||||
"DatabaseSettings": {
|
"DatabaseSettings": {
|
||||||
"FeedbacksCollectionName": "feedbacks",
|
"FeedbacksCollectionName": "feedbacks",
|
||||||
"TokensCollectionName": "tokens",
|
"TokensCollectionName": "tokens",
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
{
|
{
|
||||||
|
"Sentry": {
|
||||||
|
"Dsn": "",
|
||||||
|
"MaxRequestBodySize": "Always",
|
||||||
|
"SendDefaultPii": true,
|
||||||
|
"MinimumBreadcrumbLevel": "Debug",
|
||||||
|
"MinimumEventLevel": "Warning",
|
||||||
|
"AttachStackTrace": true,
|
||||||
|
"Debug": false,
|
||||||
|
"DiagnosticsLevel": "Error"
|
||||||
|
},
|
||||||
"DatabaseSettings": {
|
"DatabaseSettings": {
|
||||||
"FeedbacksCollectionName": "feedbacks",
|
"FeedbacksCollectionName": "feedbacks",
|
||||||
"TokensCollectionName": "tokens",
|
"TokensCollectionName": "tokens",
|
||||||
|
|
Loading…
Reference in a new issue