diff --git a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj index 567fb0f..0bccae7 100644 --- a/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj +++ b/DysonNetwork.Sphere/DysonNetwork.Sphere.csproj @@ -49,6 +49,7 @@ + diff --git a/DysonNetwork.Sphere/Program.cs b/DysonNetwork.Sphere/Program.cs index 9f9a0d9..e1d3606 100644 --- a/DysonNetwork.Sphere/Program.cs +++ b/DysonNetwork.Sphere/Program.cs @@ -29,6 +29,7 @@ using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using NodaTime; using NodaTime.Serialization.SystemTextJson; +using Prometheus; using Quartz; using StackExchange.Redis; using tusdotnet; @@ -46,6 +47,11 @@ builder.WebHost.ConfigureKestrel(options => options.Limits.RequestHeadersTimeout = TimeSpan.FromSeconds(30); }); +// Configure metrics + +builder.Services.UseHttpClientMetrics(); +builder.Services.AddHealthChecks(); + // Add services to the container. builder.Services.AddLocalization(options => options.ResourcesPath = "Resources"); @@ -236,6 +242,7 @@ using (var scope = app.Services.CreateScope()) await db.Database.MigrateAsync(); } +app.MapMetrics(); app.MapOpenApi(); app.UseSwagger();