feature: Prometheus Metrics, Supervisor Dashboard, and Promotion Retry Job

This commit is contained in:
voltsrage
2026-06-27 13:29:04 +08:00
parent e22d33b654
commit 04bdb7e85c
31 changed files with 4482 additions and 259 deletions
+10
View File
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using Minio;
using Prometheus;
using Serilog;
using StackExchange.Redis;
@@ -37,6 +38,9 @@ try
builder.Services.Configure<SiteConfigOptions>(
builder.Configuration.GetSection(SiteConfigOptions.Section));
builder.Services.Configure<PromotionRetryOptions>(
builder.Configuration.GetSection(PromotionRetryOptions.Section));
// JWT Authentication
var jwtOptions = builder.Configuration.GetSection(JwtOptions.Section).Get<JwtOptions>()!;
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
@@ -70,6 +74,10 @@ try
builder.Services.AddScoped<IDigitizationHistoryService, DigitizationHistoryService>();
builder.Services.AddScoped<IAttestationService, AttestationService>();
builder.Services.AddScoped<ILiveCaptureService, LiveCaptureService>();
builder.Services.AddScoped<IBatchEventService, BatchEventService>();
builder.Services.AddHostedService<MetricsCollectorService>();
builder.Services.AddHostedService<PromotionRetryService>();
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
@@ -90,9 +98,11 @@ try
});
}
app.UseHttpMetrics();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.MapMetrics();
if (!app.Environment.IsEnvironment("Testing"))
{