Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,4 @@ MigrationBackup/
/TransactionProcessor.SystemSetupTool/Properties/launchSettings.json
# Codex implementation worktrees
.worktrees/
/MerchantPosData
18 changes: 8 additions & 10 deletions TransactionProcessing.MerchantFileProcessor/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ClientProxyBase;
using FileProcessor.Client;
using HealthChecks.UI.Client;
using HealthMonitoring.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Hosting;
Expand All @@ -10,15 +11,16 @@
using SecurityService.Client;
using Shared.Monitoring;
using Shared.Serialisation;
using System.Reflection;
using TransactionProcessing.MerchantFileProcessor;
using TransactionProcessing.MerchantFileProcessor.Clients;
using TransactionProcessing.MerchantFileProcessor.Configuration;
using TransactionProcessing.MerchantFileProcessor.FileBuilding;
using TransactionProcessing.MerchantFileProcessor.Persistence;
using TransactionProcessing.MerchantFileProcessor.Reporting;
using TransactionProcessing.MerchantFileProcessor.Services;
using SharedLogger = Shared.Logger.Logger;
using TransactionProcessor.Client;
using SharedLogger = Shared.Logger.Logger;

var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
?? Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT")
Expand Down Expand Up @@ -49,6 +51,10 @@
.AddJsonFile("/home/txnproc/config/merchant-processing.bootstrap.local.json", optional: true, reloadOnChange: true)
.AddJsonFile("hosting.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["HealthMonitoring:Service:Version"] = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "0.0.0.0"
})
.AddCommandLine(args);

builder.WebHost.UseConfiguration(builder.Configuration);
Expand Down Expand Up @@ -131,7 +137,7 @@
builder.Services.AddSingleton<IOperationsDashboardService, OperationsDashboardService>();

builder.Services.AddHealthChecks();
builder.Services.AddUptimeKuma();
builder.Services.AddHealthMonitoringRegistration(builder.Configuration);

var app = builder.Build();

Expand Down Expand Up @@ -177,14 +183,6 @@
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});

app.Lifetime.ApplicationStarted.Register(() =>
{
app.RegisterWithUptimeKumaAsync()
.GetAwaiter()
.GetResult();
});


await app.RunAsync();
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<ItemGroup>
<PackageReference Include="FileProcessor.Client" Version="2026.9.2.153" />
<PackageReference Include="HealthMonitoring.Client" Version="2026.9.2.30" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.12" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
Expand Down
10 changes: 6 additions & 4 deletions TransactionProcessing.MerchantFileProcessor/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"EnableEfCoreCommandTrace": false,
"EnableHttpClientTrace": false
},
"UptimeKuma": {
"Monitor": {
"HealthMonitoring": {
"Service": {
"ServiceId": "merchant-file-processor",
"Name": "Merchant File Processor",
"Url": "http://localhost:9601/health",
"IntervalInSeconds": 60
"Description": "Merchant File Processor",
"HealthUrl": "http://localhost:9601/healthui"
}
},

"ConnectionStrings": {
"MerchantFileProcessor": ""
},
Expand Down
23 changes: 11 additions & 12 deletions TransactionProcessing.MerchantPos/Program.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
using ClientProxyBase;
using HealthChecks.UI.Client;
using MerchantPos.EF.Persistence;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.EntityFrameworkCore;
using NLog;
using NLog.Extensions.Logging;
using NLog.Web;
using SecurityService.Client;
using Shared.Monitoring;
using Shared.Serialisation;
using System.Reflection;
using System.Text.Json;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Shared.Monitoring;
using HealthMonitoring.Client;
using TransactionProcessing.MerchantPos.Persistence;
using TransactionProcessing.MerchantPos.Runtime;
using TransactionProcessor.Client;
Expand Down Expand Up @@ -41,6 +43,10 @@
.AddJsonFile($"appsettings.local.json", optional: true, reloadOnChange: true)
.AddJsonFile($"/home/txnproc/config/appsettings.local.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.AddInMemoryCollection(new Dictionary<string, string?>
{
["HealthMonitoring:Service:Version"] = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "0.0.0.0"
Comment thread
StuartFerguson marked this conversation as resolved.
Resolved
})
.AddCommandLine(args);

builder.Host.UseNLog();
Expand Down Expand Up @@ -95,8 +101,8 @@
});

builder.Services.AddHealthChecks();
builder.Services.AddUptimeKuma();
builder.Services.AddHealthMonitoringRegistration(builder.Configuration);

var app = builder.Build();

using (var scope = app.Services.CreateScope())
Expand Down Expand Up @@ -134,13 +140,6 @@
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});

app.Lifetime.ApplicationStarted.Register(() =>
{
app.RegisterWithUptimeKumaAsync()
.GetAwaiter()
.GetResult();
});

await app.RunAsync();
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<None Include="appsettings.development.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HealthMonitoring.Client" Version="2026.9.2.30" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.12" />
Expand All @@ -17,7 +18,7 @@
<PackageReference Include="Shared.Logger" Version="2026.9.4" />
<PackageReference Include="TransactionProcessor.Client" Version="2026.9.2.398" />
<PackageReference Include="TransactionProcessorACL.DataTransferObjects" Version="2026.9.2.157" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0"/>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<Content Update="hosting.json">
Expand Down
11 changes: 6 additions & 5 deletions TransactionProcessing.MerchantPos/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
"Microsoft.Hosting.Lifetime": "Information"
}
},
"UptimeKuma": {
"Monitor": {
"HealthMonitoring": {
"Service": {
"ServiceId": "merchant-pos",
"Name": "Merchant POS",
"Url": "http://localhost:9600/health",
"IntervalInSeconds": 60
}
"Description": "Merchant POS",
"HealthUrl": "http://localhost:9600/healthui"
}
}
}

Loading