Rrefresh automatico stati Feeder
This commit is contained in:
+1
-78
@@ -131,84 +131,6 @@ else
|
||||
logger.Info("⏸️ Telemetria e Tracing completamente disabilitati.");
|
||||
}
|
||||
|
||||
//// Check develop e conseguente Uptrace setup
|
||||
//// CONTROLLO GLOBALE: Tutto questo gira SOLO in Development
|
||||
//if (builder.Environment.IsDevelopment())
|
||||
//{
|
||||
// var uptraceEndpoint = builder.Configuration["UptraceDev:Endpoint"];
|
||||
// var uptraceDsn = builder.Configuration["UptraceDev:Dsn"];
|
||||
|
||||
// // Se le variabili di configurazione esistono nel json locale, attiviamo la magia
|
||||
// if (!string.IsNullOrEmpty(uptraceEndpoint) && !string.IsNullOrEmpty(uptraceDsn))
|
||||
// {
|
||||
// // ====================================================================
|
||||
// // 1. SETUP NLOG (Per i log in tempo reale)
|
||||
// // ====================================================================
|
||||
// var otlpTarget = new OtlpTarget
|
||||
// {
|
||||
// Name = "UptraceRealtime",
|
||||
// Endpoint = uptraceEndpoint,
|
||||
// ServiceName = "MP.DATA.Tracer",
|
||||
// Headers = $"uptrace-dsn={uptraceDsn}"
|
||||
// };
|
||||
|
||||
// var config = LogManager.Configuration ?? new NLog.Config.LoggingConfiguration();
|
||||
// config.AddTarget(otlpTarget);
|
||||
// config.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, otlpTarget);
|
||||
// LogManager.Configuration = config;
|
||||
// LogManager.ReconfigExistingLoggers();
|
||||
|
||||
// Console.WriteLine("🚀 NLog OTLP Target attivato per Uptrace in Development!");
|
||||
|
||||
// // ====================================================================
|
||||
// // 2. SETUP OPENTELEMETRY (Per gli Span, HTTP, DB e Redis in tempo reale)
|
||||
// // ====================================================================
|
||||
// var appVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0";
|
||||
|
||||
// builder.Services.AddOpenTelemetry()
|
||||
// .WithTracing(tracerProviderBuilder =>
|
||||
// {
|
||||
// tracerProviderBuilder
|
||||
// // Definiamo il nome e versione del servizio CORRENTE su Uptrace
|
||||
// .SetResourceBuilder(ResourceBuilder.CreateDefault()
|
||||
// .AddService(serviceName: "MAPO.SPEC", serviceVersion: appVersion))
|
||||
|
||||
// // Diciamo a OTel di ascoltare gli Span manuali generati
|
||||
// .AddSource("MP.DATA.Tracer")
|
||||
|
||||
// // Strumentazione Automatica
|
||||
// .AddAspNetCoreInstrumentation(options =>
|
||||
// {
|
||||
// options.Filter = (httpContext) => !httpContext.Request.Path.StartsWithSegments("/health");
|
||||
// })
|
||||
// .AddSqlClientInstrumentation(options =>
|
||||
// {
|
||||
// options.RecordException = true;
|
||||
// })
|
||||
// // Assicurati che redisMultiplexer sia inizializzato PRIMA di questo blocco
|
||||
// .AddRedisInstrumentation(redisMultiplexer)
|
||||
|
||||
// // Esporta i dati verso Uptrace
|
||||
// .AddOtlpExporter(options =>
|
||||
// {
|
||||
// options.Endpoint = new Uri(uptraceEndpoint);
|
||||
// options.Headers = $"uptrace-dsn={uptraceDsn}";
|
||||
// options.Protocol = OpenTelemetry.Exporter.OtlpExportProtocol.Grpc;
|
||||
// });
|
||||
|
||||
// // Scommenta per testare in console
|
||||
// // .AddConsoleExporter();
|
||||
// });
|
||||
|
||||
// Console.WriteLine("🚀 OpenTelemetry Tracing attivato per Uptrace in Development!");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine("⚠️ Variabili UptraceDev mancanti nel json. Telemetria realtime disabilitata.");
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
// Add services to the container.
|
||||
logger.Info("Setup Auth");
|
||||
builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
|
||||
@@ -231,6 +153,7 @@ builder.Services.AddSingleton<AppAuthService>();
|
||||
builder.Services.AddScoped<MsgServiceSpec>();
|
||||
builder.Services.AddSingleton<SharedMemService>();
|
||||
builder.Services.AddSingleton<TabDataService>();
|
||||
builder.Services.AddSingleton<TabDataFeeder>();
|
||||
builder.Services.AddBlazoredLocalStorage();
|
||||
builder.Services.AddBlazoredSessionStorage();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user