feature: Prometheus Metrics, Supervisor Dashboard, and Promotion Retry Job
This commit is contained in:
@@ -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"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user