From 230c642cfe2ff71daad37bbd706b7ec127464b64 Mon Sep 17 00:00:00 2001 From: StuartFerguson Date: Fri, 11 Sep 2026 17:28:49 +0100 Subject: [PATCH] add uptime kuma and update nugets --- Directory.Packages.props | 38 +++++++++---------- EstateManagementUI.BlazorServer/Program.cs | 10 +++++ .../appsettings.json | 7 ++++ 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3260542b..35ff8501 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,41 +6,41 @@ - + - + - - - - - - - + + + + + + + - + - - - - - - + + + + + + - - + + - + \ No newline at end of file diff --git a/EstateManagementUI.BlazorServer/Program.cs b/EstateManagementUI.BlazorServer/Program.cs index 0ed37d99..2c568b66 100644 --- a/EstateManagementUI.BlazorServer/Program.cs +++ b/EstateManagementUI.BlazorServer/Program.cs @@ -12,6 +12,7 @@ using System.Reflection; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Components.Server; +using Shared.Monitoring; WebApplicationBuilder builder = WebApplication.CreateBuilder(args).LoadConfiguration().ConfigureKestrel(); @@ -95,6 +96,8 @@ builder.RegisterUIServices().RegisterSerialiser(); +builder.Services.AddUptimeKuma(); + // Add Health Checks - read URLs from configuration var estateReportingApiUrl = builder.Configuration.GetValue("AppSettings:EstateReportingApi") ?? "http://localhost:5011"; @@ -185,6 +188,13 @@ Uri ValidateAndCreateUri(string url, string configKey) ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); +app.Lifetime.ApplicationStarted.Register(() => +{ + app.RegisterWithUptimeKumaAsync() + .GetAwaiter() + .GetResult(); +}); + app.Run(); diff --git a/EstateManagementUI.BlazorServer/appsettings.json b/EstateManagementUI.BlazorServer/appsettings.json index b646592b..60c74755 100644 --- a/EstateManagementUI.BlazorServer/appsettings.json +++ b/EstateManagementUI.BlazorServer/appsettings.json @@ -32,5 +32,12 @@ "fileProcessor", "transactionProcessor" ] + }, + "UptimeKuma": { + "Monitor": { + "Name": "Estate Management UI", + "Url": "http://localhost:5004/health", + "IntervalInSeconds": 60 + } } }