Skip to content

Commit

Permalink
Add bugsnag
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Sep 12, 2024
1 parent 2da4beb commit 3168e85
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cSpell.words": [
"ASPNETCORE",
"Bson",
"Bugsnag",
"hmac",
"HMACSHA",
"inferencing",
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
- ASPNETCORE_Translation__Engines__1__Address=http://machine-engine
- ASPNETCORE_Translation__Engines__2__Type=Nmt
- ASPNETCORE_Translation__Engines__2__Address=http://machine-engine
- "Bugsnag__ApiKey=${Bugsnag__ApiKey:?access key needed}"
expose:
- 80
- 81
Expand Down Expand Up @@ -52,6 +53,7 @@ services:
- ASPNETCORE_Kestrel__Endpoints__Http__Url=http://*:80
- ASPNETCORE_Kestrel__EndpointDefaults__Protocols=Http2
- ASPNETCORE_ConnectionStrings__TranslationPlatformApi=http://serval-api:81
- "Bugsnag__ApiKey=${Bugsnag__ApiKey:?access key needed}"
expose:
- 80
ports:
Expand Down Expand Up @@ -96,6 +98,7 @@ services:
- SharedFile__Uri=s3://silnlp/docker-compose/
- "SharedFile__S3AccessKeyId=${AWS_ACCESS_KEY_ID:?access key needed}"
- "SharedFile__S3SecretAccessKey=${AWS_SECRET_ACCESS_KEY:?secret key needed}"
- "Bugsnag__ApiKey=${Bugsnag__ApiKey:?access key needed}"
expose:
- 80
ports:
Expand Down Expand Up @@ -141,6 +144,7 @@ services:
- SharedFile__Uri=s3://silnlp/docker-compose/
- "SharedFile__S3AccessKeyId=${AWS_ACCESS_KEY_ID:?access key needed}"
- "SharedFile__S3SecretAccessKey=${AWS_SECRET_ACCESS_KEY:?secret key needed}"
- "Bugsnag__ApiKey=${Bugsnag__ApiKey:?access key needed}"
expose:
- 80
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\ServiceToolkit\src\SIL.ServiceToolkit\SIL.ServiceToolkit.csproj" />
<ProjectReference Include="..\..\..\Serval\src\Serval.Grpc\Serval.Grpc.csproj" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions src/Echo/src/EchoTranslationEngine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

builder.Services.AddHealthChecks().AddCheck("Live", () => HealthCheckResult.Healthy());

builder.Services.Configure<Bugsnag.Configuration>(builder.Configuration.GetSection("Bugsnag"));
builder.Services.AddBugsnag();

WebApplication app = builder.Build();

// Configure the HTTP request pipeline.
Expand Down
1 change: 1 addition & 0 deletions src/Echo/src/EchoTranslationEngine/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
global using System.Threading.Channels;
global using Bugsnag.AspNet.Core;
global using EchoTranslationEngine;
global using Google.Protobuf.WellKnownTypes;
global using Grpc.Core;
Expand Down
4 changes: 4 additions & 0 deletions src/Machine/src/Serval.Machine.EngineServer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Bugsnag.AspNet.Core;
using Hangfire;
using OpenTelemetry.Trace;

Expand Down Expand Up @@ -29,6 +30,9 @@
});
}

builder.Services.Configure<Bugsnag.Configuration>(builder.Configuration.GetSection("Bugsnag"));
builder.Services.AddBugsnag();

var app = builder.Build();

app.UseHttpsRedirection();
Expand Down
4 changes: 4 additions & 0 deletions src/Machine/src/Serval.Machine.JobServer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Bugsnag.AspNet.Core;
using OpenTelemetry.Trace;

var builder = WebApplication.CreateBuilder(args);
Expand Down Expand Up @@ -25,6 +26,9 @@
});
}

builder.Services.Configure<Bugsnag.Configuration>(builder.Configuration.GetSection("Bugsnag"));
builder.Services.AddBugsnag();

var app = builder.Build();

app.Run();
2 changes: 2 additions & 0 deletions src/Serval/src/Serval.ApiServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ public void ConfigureServices(IServiceCollection services)
.AddOpenTelemetry()
.WithMetrics(opts => opts.AddAspNetCoreInstrumentation().AddPrometheusExporter());
}
services.Configure<Bugsnag.Configuration>(Configuration.GetSection("Bugsnag"));
services.AddBugsnag();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
Expand Down
1 change: 1 addition & 0 deletions src/Serval/src/Serval.ApiServer/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
global using System.Security.Claims;
global using System.Text.Json.Serialization;
global using Asp.Versioning;
global using Bugsnag.AspNet.Core;
global using Hangfire;
global using Hangfire.Mongo;
global using Hangfire.Mongo.Migration.Strategies;
Expand Down
1 change: 1 addition & 0 deletions src/Serval/src/Serval.Shared/Serval.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\DataAccess\src\SIL.DataAccess\SIL.DataAccess.csproj" />
<ProjectReference Include="..\..\..\ServiceToolkit\src\SIL.ServiceToolkit\SIL.ServiceToolkit.csproj" />
<ProjectReference Include="..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj" Condition="Exists('..\..\..\..\..\machine\src\SIL.Machine\SIL.Machine.csproj')" />
<ProjectReference Include="..\Serval.Grpc\Serval.Grpc.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.1.0" />
<PackageReference Include="Grpc.Core.Api" Version="2.65.0" />
<PackageReference Include="Hangfire.Core" Version="1.8.14" />
<PackageReference Include="SIL.WritingSystems" Version="14.1.1" />
Expand Down

0 comments on commit 3168e85

Please sign in to comment.